Skip to content

Commit fb34d46

Browse files
authored
Merge branch 'main' into run-modernize
2 parents 0e07826 + 0efdd61 commit fb34d46

File tree

8 files changed

+21
-13
lines changed

8 files changed

+21
-13
lines changed

.github/workflows/checks.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
runs-on: ubuntu-latest
2525
steps:
2626
- name: Check out code
27-
uses: actions/checkout@v4
27+
uses: actions/checkout@v5
2828
- name: Set up Go
2929
uses: actions/setup-go@v5
3030
with:
@@ -34,8 +34,10 @@ jobs:
3434
uses: golangci/golangci-lint-action@v8
3535
with:
3636
version: latest
37+
- name: Delete pre-installed shellcheck
38+
run: sudo rm -f $(which shellcheck)
3739
- name: Run shellcheck
38-
uses: ludeeus/action-shellcheck@2.0.0
40+
run: make run-shellcheck
3941
- name: Dependency Licenses Review
4042
run: make check-dependency-licenses
4143
- name: Check for spelling errors

.github/workflows/codeql.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
runs-on: ubuntu-latest
2828
steps:
2929
- name: Check out code
30-
uses: actions/checkout@v4
30+
uses: actions/checkout@v5
3131
- name: Set up Go
3232
uses: actions/setup-go@v5
3333
with:

.license-scan-overrides.jsonl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{"name": "github.com/chzyer/logex", "licenceType": "MIT"}
22
{"name": "github.com/hashicorp/vault/api/auth/approle", "licenceType": "MPL-2.0"}
33
{"name": "github.com/jpillora/longestcommon", "licenceType": "MIT"}
4+
{"name": "github.com/logrusorgru/aurora", "licenceType": "Unlicense"}
45
{"name": "github.com/mattn/go-localereader", "licenceType": "MIT"}
56
{"name": "github.com/miekg/dns", "licenceType": "BSD-3-Clause"}
7+
{"name": "github.com/pashagolub/pgxmock/v4", "licenceType": "BSD-3-Clause"}
68
{"name": "github.com/spdx/tools-golang", "licenceTextOverrideFile": "vendor/github.com/spdx/tools-golang/LICENSE.code"}
79
{"name": "github.com/xeipuuv/gojsonpointer", "licenceType": "Apache-2.0"}
810
{"name": "github.com/xeipuuv/gojsonreference", "licenceType": "Apache-2.0"}
911
{"name": "github.com/xeipuuv/gojsonschema", "licenceType": "Apache-2.0"}
10-
{"name": "github.com/pashagolub/pgxmock/v4", "licenceType": "BSD-3-Clause"}
11-
{"name": "github.com/logrusorgru/aurora", "licenceType": "Unlicense"}

Makefile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,18 @@ install-modernize: FORCE
4343
@if ! hash modernize 2>/dev/null; then printf "\e[1;36m>> Installing modernize (this may take a while)...\e[0m\n"; go install golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest; fi
4444

4545
install-shellcheck: FORCE
46-
@if ! hash shellcheck 2>/dev/null; then printf "\e[1;36m>> Installing shellcheck...\e[0m\n"; SHELLCHECK_ARCH=$(shell uname -m); SHELLCHECK_OS=$(shell uname -s | tr '[:upper:]' '[:lower:]'); if [[ "$$SHELLCHECK_OS" == "darwin" ]]; then SHELLCHECK_OS=macos; fi; SHELLCHECK_VERSION="stable"; curl -sLo- "https://github.com/koalaman/shellcheck/releases/download/$$SHELLCHECK_VERSION/shellcheck-$$SHELLCHECK_VERSION.$$SHELLCHECK_OS.$$SHELLCHECK_ARCH.tar.xz" | tar -Jxf -; BIN=$$(go env GOBIN); if [[ -z $$BIN ]]; then BIN=$$(go env GOPATH)/bin; fi; install -Dm755 shellcheck-$$SHELLCHECK_VERSION/shellcheck -t "$$BIN"; rm -rf shellcheck-$$SHELLCHECK_VERSION; fi
46+
@if ! hash shellcheck 2>/dev/null; then printf "\e[1;36m>> Installing shellcheck...\e[0m\n"; SHELLCHECK_ARCH=$(shell uname -m); SHELLCHECK_OS=$(shell uname -s | tr '[:upper:]' '[:lower:]'); if [[ "$$SHELLCHECK_OS" == "darwin" ]]; then SHELLCHECK_OS=macos; fi; SHELLCHECK_VERSION="stable"; if command -v curl >/dev/null 2>&1; then GET="curl -sLo-"; elif command -v wget >/dev/null 2>&1; then GET="wget -O-"; else echo "Didn't find curl or wget to download shellcheck"; exit 2; fi; $$GET "https://github.com/koalaman/shellcheck/releases/download/$$SHELLCHECK_VERSION/shellcheck-$$SHELLCHECK_VERSION.$$SHELLCHECK_OS.$$SHELLCHECK_ARCH.tar.xz" | tar -Jxf -; BIN=$$(go env GOBIN); if [[ -z $$BIN ]]; then BIN=$$(go env GOPATH)/bin; fi; install -Dm755 shellcheck-$$SHELLCHECK_VERSION/shellcheck -t "$$BIN"; rm -rf shellcheck-$$SHELLCHECK_VERSION; fi
4747

4848
install-go-licence-detector: FORCE
4949
@if ! hash go-licence-detector 2>/dev/null; then printf "\e[1;36m>> Installing go-licence-detector (this may take a while)...\e[0m\n"; go install go.elastic.co/go-licence-detector@latest; fi
5050

5151
install-addlicense: FORCE
5252
@if ! hash addlicense 2>/dev/null; then printf "\e[1;36m>> Installing addlicense (this may take a while)...\e[0m\n"; go install github.com/google/addlicense@latest; fi
5353

54-
prepare-static-check: FORCE install-golangci-lint install-modernize install-shellcheck install-go-licence-detector install-addlicense
54+
install-reuse: FORCE
55+
@if ! hash reuse 2>/dev/null; then if ! hash pip3 2>/dev/null; then printf "\e[1;31m>> Cannot install reuse because no pip3 was found. Either install it using your package manager or install pip3\e[0m\n"; else printf "\e[1;36m>> Installing reuse...\e[0m\n"; pip3 install --user reuse; fi; fi
56+
57+
prepare-static-check: FORCE install-golangci-lint install-modernize install-shellcheck install-go-licence-detector install-addlicense install-reuse
5558

5659
GO_BUILDFLAGS =
5760
GO_LDFLAGS =
@@ -140,7 +143,7 @@ check-addlicense: FORCE install-addlicense
140143
@printf "\e[1;36m>> addlicense --check\e[0m\n"
141144
@addlicense --check -- $(patsubst $(shell awk '$$1 == "module" {print $$2}' go.mod)%,.%/*.go,$(shell go list ./...))
142145

143-
check-reuse: FORCE
146+
check-reuse: FORCE install-reuse
144147
@printf "\e[1;36m>> reuse lint\e[0m\n"
145148
@if ! reuse lint -q; then reuse lint; fi
146149

@@ -158,7 +161,7 @@ tidy-deps: FORCE
158161
go mod tidy
159162
go mod verify
160163

161-
license-headers: FORCE install-addlicense
164+
license-headers: FORCE install-addlicense install-reuse
162165
@printf "\e[1;36m>> addlicense (for license headers on source code files)\e[0m\n"
163166
@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: +'"'"' {}; '
164167
@printf "\e[1;36m>> reuse annotate (for license headers on other files)\e[0m\n"
@@ -214,6 +217,7 @@ help: FORCE
214217
@printf " \e[36minstall-shellcheck\e[0m Install shellcheck required by run-shellcheck/static-check\n"
215218
@printf " \e[36minstall-go-licence-detector\e[0m Install-go-licence-detector required by check-dependency-licenses/static-check\n"
216219
@printf " \e[36minstall-addlicense\e[0m Install addlicense required by check-license-headers/license-headers/static-check\n"
220+
@printf " \e[36minstall-reuse\e[0m Install reuse required by license-headers/check-reuse\n"
217221
@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"
218222
@printf "\n"
219223
@printf "\e[1mBuild\e[0m\n"

REUSE.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ SPDX-License-Identifier = "Apache-2.0"
2222
[[annotations]]
2323
path = [
2424
"etc/*",
25-
"build/*",
2625
"internal/agent/f5/mocks_test.go",
26+
"build/*",
2727
]
2828
SPDX-FileCopyrightText = "SAP SE or an SAP affiliate company"
2929
SPDX-License-Identifier = "Apache-2.0"

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ require (
4242
github.com/prometheus/client_golang v1.23.0
4343
github.com/rs/cors v1.11.1
4444
github.com/sapcc/go-api-declarations v1.17.3
45-
github.com/sapcc/go-bits v0.0.0-20250811141703-79d9564d7be1
45+
github.com/sapcc/go-bits v0.0.0-20250815083328-9eefdef740e1
4646
github.com/sethvargo/go-retry v0.3.0
4747
github.com/sirupsen/logrus v1.9.3
4848
github.com/stretchr/testify v1.10.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,8 @@ github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU
244244
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
245245
github.com/sapcc/go-api-declarations v1.17.3 h1:ILRfsFD9ChSeekyzlDInLMqjC830gBcyK6ULlFdP45I=
246246
github.com/sapcc/go-api-declarations v1.17.3/go.mod h1:MWmLjmvjftgyAugNUfIhsDsHIzXH1pn32cWLZpiluKg=
247-
github.com/sapcc/go-bits v0.0.0-20250811141703-79d9564d7be1 h1:SFANSgW2WDrbu0XpUfEa7MCpjqD9R2d8AHlkmy4ljuY=
248-
github.com/sapcc/go-bits v0.0.0-20250811141703-79d9564d7be1/go.mod h1:z6WAygWMeZsLuWa/7iE09Ah5/fpqSZS/G/FNi2j6oIY=
247+
github.com/sapcc/go-bits v0.0.0-20250815083328-9eefdef740e1 h1:EZ3lO7jyH++ZIOjh9p6B0pMNlU2/rnUxE0TOhGpFt9c=
248+
github.com/sapcc/go-bits v0.0.0-20250815083328-9eefdef740e1/go.mod h1:pMKo3e45ENJVwoTNqz/RWaRg0t++ySpjqWgygBjDFuM=
249249
github.com/sergi/go-diff v1.4.0 h1:n/SP9D5ad1fORl+llWyN+D6qoUETXNZARKjyY2/KVCw=
250250
github.com/sergi/go-diff v1.4.0/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4=
251251
github.com/sethvargo/go-retry v0.3.0 h1:EEt31A35QhrcRZtrYFDTBg91cqZVnFL2navjDrah2SE=

shell.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ mkShell {
1111
go-licence-detector
1212
go_1_24
1313
gotools # goimports
14+
postgresql_17
15+
reuse
1416
# keep this line if you use bash
1517
bashInteractive
1618
];

0 commit comments

Comments
 (0)