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

Commit f6b7c86

Browse files
authored
Merge pull request #415 from GoogleContainerTools/cleanup
Bring repository up to date
2 parents 5d44978 + d26f7e6 commit f6b7c86

14 files changed

+42
-279
lines changed

.github/workflows/build.yaml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: "Build and test"
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request: {}
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
17+
- name: Install Go
18+
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
19+
with:
20+
go-version-file: go.mod
21+
- name: Install addlicense
22+
run: go install github.com/google/addlicense@v1.1.1
23+
- name: Run tests
24+
run: make test
25+
- name: Run integration tests
26+
run: make integration

boilerplate/boilerplate.Dockerfile.txt

-14
This file was deleted.

boilerplate/boilerplate.Makefile.txt

-14
This file was deleted.

boilerplate/boilerplate.go.txt

-16
This file was deleted.

boilerplate/boilerplate.py

-170
This file was deleted.

boilerplate/boilerplate.py.txt

-16
This file was deleted.

boilerplate/boilerplate.sh.txt

-14
This file was deleted.

differs/apt_diff.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828
"github.com/sirupsen/logrus"
2929
)
3030

31-
//APT package database location
31+
// APT package database location
3232
const dpkgStatusFile string = "var/lib/dpkg/status"
3333

3434
type AptAnalyzer struct {

differs/emerge_diff.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828
"github.com/sirupsen/logrus"
2929
)
3030

31-
//Emerge package database location
31+
// Emerge package database location
3232
const emergePkgFile string = "/var/db/pkg"
3333

3434
type EmergeAnalyzer struct{}

differs/rpm_diff.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ import (
4545
"github.com/sirupsen/logrus"
4646
)
4747

48-
//RPM macros file location
48+
// RPM macros file location
4949
const rpmMacros string = "/usr/lib/rpm/macros"
5050

51-
//RPM command to extract packages from the rpm database
51+
// RPM command to extract packages from the rpm database
5252
var rpmCmd = []string{
5353
"rpm", "--nodigest", "--nosignature",
5454
"-qa", "--qf", "%{NAME}\t%{VERSION}-%{RELEASE}\t%{SIZE}\n",

pkg/util/fs_utils.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func GetSize(path string) int64 {
5454
return stat.Size()
5555
}
5656

57-
//GetFileContents returns the contents of a file at the specified path
57+
// GetFileContents returns the contents of a file at the specified path
5858
func GetFileContents(path string) (*string, error) {
5959
if _, err := os.Lstat(path); os.IsNotExist(err) {
6060
return nil, err

test.sh

+2-22
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,5 @@ if [[ $files ]]; then
2626
exit 1
2727
fi
2828

29-
# Check for python on host, and use it if possible, otherwise fall back on python dockerized
30-
if [[ -f $(which python 2>&1) ]]; then
31-
PYTHON="python"
32-
else
33-
PYTHON="docker run --rm -it -v $(pwd):/container-diff -w /container-diff python python"
34-
fi
35-
36-
37-
# Ignore these paths in the following tests.
38-
ignore="vendor\|out\|actions\|setup-tests"
39-
40-
# Check boilerplate
41-
echo "Checking boilerplate..."
42-
BOILERPLATEDIR=./boilerplate
43-
# Grep returns a non-zero exit code if we don't match anything, which is good in this case.
44-
set +e
45-
files=$(${PYTHON} ${BOILERPLATEDIR}/boilerplate.py --rootdir . --boilerplate-dir ${BOILERPLATEDIR} | grep -v $ignore)
46-
set -e
47-
if [[ ! -z ${files} ]]; then
48-
echo "Boilerplate missing in: ${files}."
49-
exit 1
50-
fi
29+
echo "Checking go-addlicense..."
30+
addlicense -check -l apache -ignore \{actions,differs,vendor,setup-tests,out\}/**/* -ignore cloudbuild\*yaml *

0 commit comments

Comments
 (0)