You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Makefile
+7-3Lines changed: 7 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -42,7 +42,10 @@ install-go-licence-detector: FORCE
42
42
install-addlicense: FORCE
43
43
@if !hash addlicense 2>/dev/null;thenprintf"\e[1;36m>> Installing addlicense (this may take a while)...\e[0m\n"; go install github.com/google/addlicense@latest;fi
44
44
45
-
prepare-static-check: FORCE install-golangci-lint install-modernize install-shellcheck install-go-licence-detector install-addlicense
45
+
install-reuse: FORCE
46
+
@if !hash reuse 2>/dev/null;thenif!hash pip3 2>/dev/null;thenprintf"\e[1;31m>> Cannot install reuse because no pip3 was found. Either install it using your package manager or install pip3\e[0m\n";elseprintf"\e[1;36m>> Installing reuse...\e[0m\n"; pip3 install --user reuse;fi;fi
47
+
48
+
prepare-static-check: FORCE install-golangci-lint install-modernize install-shellcheck install-go-licence-detector install-addlicense install-reuse
46
49
47
50
GO_BUILDFLAGS = -mod vendor
48
51
GO_LDFLAGS =
@@ -111,7 +114,7 @@ check-addlicense: FORCE install-addlicense
111
114
@printf "\e[1;36m>> addlicense --check\e[0m\n"
112
115
@addlicense --check -- $(patsubst$(shell awk '$$1 == "module" {print $$2}' go.mod)%,.%/*.go,$(shell go list ./...))
113
116
114
-
check-reuse: FORCE
117
+
check-reuse: FORCE install-reuse
115
118
@printf "\e[1;36m>> reuse lint\e[0m\n"
116
119
@if ! reuse lint -q;then reuse lint;fi
117
120
@@ -135,7 +138,7 @@ vendor-compat: FORCE
135
138
go mod vendor
136
139
go mod verify
137
140
138
-
license-headers: FORCE install-addlicense
141
+
license-headers: FORCE install-addlicense install-reuse
139
142
@printf "\e[1;36m>> addlicense (for license headers on source code files)\e[0m\n"
140
143
@printf "%s\0"$(patsubst$(shell awk '$$1 == "module" {print $$2}' go.mod)%,.%/*.go,$(shell go list ./...))|$(XARGS) -0 -I{} bash -c 'year="$$(grep 'Copyright' {} | head -n1 | grep -E -o '"'"'[0-9]{4}(-[0-9]{4})?'"'"')"; if [[ -z "$$year" ]]; then year=$$(date +%Y); fi; gawk -i inplace '"'"'{if (display) {print} else {!/^\/\*/ && !/^\*/}}; {if (!display && $$0 ~ /^(package |$$)/) {display=1} else { }}'"'"' {}; addlicense -c "SAP SE or an SAP affiliate company" -s=only -y "$$year" -- {}; $(SED) -i '"'"'1s+// Copyright +// SPDX-FileCopyrightText: +'"'"' {}; '
141
144
@printf "\e[1;36m>> reuse annotate (for license headers on other files)\e[0m\n"
@@ -191,6 +194,7 @@ help: FORCE
191
194
@printf " \e[36minstall-shellcheck\e[0m Install shellcheck required by run-shellcheck/static-check\n"
192
195
@printf " \e[36minstall-go-licence-detector\e[0m Install-go-licence-detector required by check-dependency-licenses/static-check\n"
193
196
@printf " \e[36minstall-addlicense\e[0m Install addlicense required by check-license-headers/license-headers/static-check\n"
197
+
@printf " \e[36minstall-reuse\e[0m Install reuse required by license-headers/check-reuse\n"
194
198
@printf " \e[36mprepare-static-check\e[0m Install any tools required by static-check. This is used in CI before dropping privileges, you should probably install all the tools using your package manager\n"
0 commit comments