From 1f693245174f6548d5949796c634a4dce70ae82e Mon Sep 17 00:00:00 2001 From: SuperQ Date: Sat, 12 Aug 2023 05:33:28 +0200 Subject: [PATCH] Update building * Remove unused / non-standard .go-version. * Cleanup indenting in Makefile. * Enable dependabot for subdirs. * Update golanci-lint CI. * Update go.mod version directives to match supported versions. * Disable golanci-lint unused-parameter. Signed-off-by: SuperQ --- .github/dependabot.yml | 8 ++++++++ .github/workflows/golangci-lint.yml | 6 +++--- .go-version | 1 - .golangci.yml | 6 ++++++ Makefile | 4 ++-- examples/middleware/go.mod | 2 +- go.mod | 2 +- 7 files changed, 21 insertions(+), 8 deletions(-) delete mode 100644 .go-version diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 202ae2366..5b2345d82 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,3 +4,11 @@ updates: directory: "/" schedule: interval: "monthly" + - package-ecosystem: "gomod" + directory: "/examples/middleware" + schedule: + interval: "monthly" + - package-ecosystem: "gomod" + directory: "/tutorial/whatsup" + schedule: + interval: "monthly" diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 29e1f564e..279a784d6 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -25,9 +25,9 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 - name: install Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v3 with: - go-version: 1.18.x + go-version: 1.20.x - name: Install snmp_exporter/generator dependencies run: sudo apt-get update && sudo apt-get -y install libsnmp-dev if: github.repository == 'prometheus/snmp_exporter' @@ -35,4 +35,4 @@ jobs: uses: golangci/golangci-lint-action@v3.4.0 with: args: --verbose - version: v1.51.2 + version: v1.53.3 diff --git a/.go-version b/.go-version deleted file mode 100644 index d2ab029d3..000000000 --- a/.go-version +++ /dev/null @@ -1 +0,0 @@ -1.21 diff --git a/.golangci.yml b/.golangci.yml index 7e1953030..f7a4fc987 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -45,3 +45,9 @@ linters-settings: local-prefixes: github.com/prometheus/client_golang gofumpt: extra-rules: true + revive: + rules: + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unused-parameter + - name: unused-parameter + severity: warning + disabled: true diff --git a/Makefile b/Makefile index 4cfdc1f44..09614813d 100644 --- a/Makefile +++ b/Makefile @@ -24,9 +24,9 @@ test-short: deps common-test-short VERSIONS := 1.19 1.20 1.21 generate-go-collector-test-files: for GO_VERSION in $(VERSIONS); do \ - docker run --rm -v $(PWD):/workspace -w /workspace golang:$$GO_VERSION go run prometheus/gen_go_collector_metrics_set.go; \ + docker run --rm -v $(PWD):/workspace -w /workspace golang:$$GO_VERSION go run prometheus/gen_go_collector_metrics_set.go; \ mv -f go_collector_metrics* prometheus; \ - done + done .PHONY: fmt fmt: common-format diff --git a/examples/middleware/go.mod b/examples/middleware/go.mod index 718b3ae65..ecc5d9ee2 100644 --- a/examples/middleware/go.mod +++ b/examples/middleware/go.mod @@ -1,6 +1,6 @@ module github.com/jessicalins/instrumentation-practices-examples/middleware -go 1.17 +go 1.19 require github.com/prometheus/client_golang v1.13.1 diff --git a/go.mod b/go.mod index 9c354dfaf..ba604d377 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/prometheus/client_golang -go 1.17 +go 1.19 require ( github.com/beorn7/perks v1.0.1