Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

Commit

Permalink
Merge pull request #415 from GoogleContainerTools/cleanup
Browse files Browse the repository at this point in the history
Bring repository up to date
  • Loading branch information
loosebazooka authored Feb 15, 2024
2 parents 5d44978 + d26f7e6 commit f6b7c86
Show file tree
Hide file tree
Showing 14 changed files with 42 additions and 279 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: "Build and test"

on:
push:
branches: [main]
pull_request: {}

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version-file: go.mod
- name: Install addlicense
run: go install github.com/google/[email protected]
- name: Run tests
run: make test
- name: Run integration tests
run: make integration
14 changes: 0 additions & 14 deletions boilerplate/boilerplate.Dockerfile.txt

This file was deleted.

14 changes: 0 additions & 14 deletions boilerplate/boilerplate.Makefile.txt

This file was deleted.

16 changes: 0 additions & 16 deletions boilerplate/boilerplate.go.txt

This file was deleted.

170 changes: 0 additions & 170 deletions boilerplate/boilerplate.py

This file was deleted.

16 changes: 0 additions & 16 deletions boilerplate/boilerplate.py.txt

This file was deleted.

14 changes: 0 additions & 14 deletions boilerplate/boilerplate.sh.txt

This file was deleted.

2 changes: 1 addition & 1 deletion differs/apt_diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"github.com/sirupsen/logrus"
)

//APT package database location
// APT package database location
const dpkgStatusFile string = "var/lib/dpkg/status"

type AptAnalyzer struct {
Expand Down
2 changes: 1 addition & 1 deletion differs/emerge_diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"github.com/sirupsen/logrus"
)

//Emerge package database location
// Emerge package database location
const emergePkgFile string = "/var/db/pkg"

type EmergeAnalyzer struct{}
Expand Down
4 changes: 2 additions & 2 deletions differs/rpm_diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ import (
"github.com/sirupsen/logrus"
)

//RPM macros file location
// RPM macros file location
const rpmMacros string = "/usr/lib/rpm/macros"

//RPM command to extract packages from the rpm database
// RPM command to extract packages from the rpm database
var rpmCmd = []string{
"rpm", "--nodigest", "--nosignature",
"-qa", "--qf", "%{NAME}\t%{VERSION}-%{RELEASE}\t%{SIZE}\n",
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/fs_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func GetSize(path string) int64 {
return stat.Size()
}

//GetFileContents returns the contents of a file at the specified path
// GetFileContents returns the contents of a file at the specified path
func GetFileContents(path string) (*string, error) {
if _, err := os.Lstat(path); os.IsNotExist(err) {
return nil, err
Expand Down
24 changes: 2 additions & 22 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,5 @@ if [[ $files ]]; then
exit 1
fi

# Check for python on host, and use it if possible, otherwise fall back on python dockerized
if [[ -f $(which python 2>&1) ]]; then
PYTHON="python"
else
PYTHON="docker run --rm -it -v $(pwd):/container-diff -w /container-diff python python"
fi


# Ignore these paths in the following tests.
ignore="vendor\|out\|actions\|setup-tests"

# Check boilerplate
echo "Checking boilerplate..."
BOILERPLATEDIR=./boilerplate
# Grep returns a non-zero exit code if we don't match anything, which is good in this case.
set +e
files=$(${PYTHON} ${BOILERPLATEDIR}/boilerplate.py --rootdir . --boilerplate-dir ${BOILERPLATEDIR} | grep -v $ignore)
set -e
if [[ ! -z ${files} ]]; then
echo "Boilerplate missing in: ${files}."
exit 1
fi
echo "Checking go-addlicense..."
addlicense -check -l apache -ignore \{actions,differs,vendor,setup-tests,out\}/**/* -ignore cloudbuild\*yaml *
Loading

0 comments on commit f6b7c86

Please sign in to comment.