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

Commit

Permalink
Switch to using addlicense for copyright header validation
Browse files Browse the repository at this point in the history
Signed-off-by: Piotr Stankiewicz <piotr.stankiewicz@docker.com>
  • Loading branch information
p1-0tr committed Jul 13, 2022
1 parent ff8e2dc commit 718f596
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 63 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ RUN --mount=target=. \
make -f builder.Makefile test

FROM base AS check-license-headers
RUN go get -u github.com/kunalkushwaha/ltag
RUN go install github.com/google/addlicense@latest
RUN --mount=target=. \
make -f builder.Makefile check-license-headers

Expand Down
12 changes: 5 additions & 7 deletions scripts/validate/fileheader
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env sh

# Copyright Docker Compose CLI authors
# Copyright 2020, 2022 Docker Compose CLI authors

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -16,12 +16,10 @@

set -eu -o pipefail

if ! command -v ltag; then
>&2 echo "ERROR: ltag not found. Install with:"
>&2 echo " go get -u github.com/kunalkushwaha/ltag"
if ! command -v addlicense; then
>&2 echo "ERROR: addlicense not found. Install with:"
>&2 echo " go install github.com/google/addlicense@latest"
exit 1
fi

BASEPATH="${1-}"

ltag -t "${BASEPATH}scripts/validate/template" -excludes "validate testdata resolvepath" --check -v
find . -regex '.*\.sh' -o -regex '.*\.go' -o -regex '.*Makefile' -o -regex '.*Dockerfile' | xargs addlicense -check -l apache -c 'Docker Compose CLI authors' -ignore validate -ignore testdata -ignore resolvepath -v 1>&2
13 changes: 0 additions & 13 deletions scripts/validate/template/bash.txt

This file was deleted.

13 changes: 0 additions & 13 deletions scripts/validate/template/dockerfile.txt

This file was deleted.

16 changes: 0 additions & 16 deletions scripts/validate/template/go.txt

This file was deleted.

13 changes: 0 additions & 13 deletions scripts/validate/template/makefile.txt

This file was deleted.

0 comments on commit 718f596

Please sign in to comment.