Skip to content

Commit 5cc5c5e

Browse files
authored
Merge pull request #3449 from afbjorklund/lint-licenses
Add license checking to lint
2 parents 56702e0 + 32ec67f commit 5cc5c5e

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
run: go install github.com/google/[email protected]
6666
- name: Check licenses
6767
# the allow list corresponds to https://github.com/cncf/foundation/blob/e5db022a0009f4db52b89d9875640cf3137153fe/allowed-third-party-license-policy.md
68-
run: go-licenses check --include_tests ./... --allowed_licenses=Apache-2.0,BSD-2-Clause,BSD-2-Clause-FreeBSD,BSD-3-Clause,MIT,ISC,Python-2.0,PostgreSQL,X11,Zlib
68+
run: go-licenses check --include_tests ./... --allowed_licenses=$(cat ./hack/allowed-licenses.txt)
6969
- name: Install ltag
7070
# The GitHub repo has been moved from kunalkushwaha/ltag to containerd/ltag,
7171
# but the Go module name is not changed yet: https://github.com/containerd/ltag/issues/17

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,8 @@ lint: check-generated
474474
ls-lint
475475
find . -name '*.sh' ! -path "./.git/*" | xargs shellcheck
476476
find . -name '*.sh' ! -path "./.git/*" | xargs shfmt -s -d
477+
go-licenses check --include_tests ./... --allowed_licenses=$$(cat ./hack/allowed-licenses.txt)
478+
ltag -t ./hack/ltag --check -v
477479

478480
.PHONY: clean
479481
clean:

hack/allowed-licenses.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Apache-2.0,BSD-2-Clause,BSD-2-Clause-FreeBSD,BSD-3-Clause,MIT,ISC,Python-2.0,PostgreSQL,X11,Zlib

0 commit comments

Comments
 (0)