From 42e8520f706aebe0675d86bb50b91a5b9f76c20f Mon Sep 17 00:00:00 2001 From: Hilmar Falkenberg Date: Mon, 3 Jun 2024 17:45:01 +0200 Subject: [PATCH 1/5] set go v1.22 for lint --- .golangci.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.golangci.yaml b/.golangci.yaml index 9e4ab89249..e31bbcc18c 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -1,5 +1,5 @@ run: - go: "1.21" + go: "1.22" timeout: 10m tests: false allow-parallel-runners: true @@ -42,10 +42,10 @@ linters: - nlreturn # Use empty line at least before return/break/continue. - goerr113 # Do not define dynamic errors with Errorf. - varnamelen # m, d, p < These are not so meaningful variables. - - testpackage # Blackbox testing is preffered. + - testpackage # Blackbox testing is preferred. - funlen # Break long functions. - gomnd # Give constant values a name with constants. - - ireturn # Accept interface, return concrate. + - ireturn # Accept interface, return concrete. - nestif # Some nexted if statements are 8 or 9 deep. - dupl # Check code duplications. - cyclop # Complex functions are not good. @@ -109,9 +109,9 @@ linters-settings: - prefix(github.com/open-component-model/ocm) custom-order: true staticcheck: - go: "1.21" + go: "1.22" stylecheck: - go: "1.21" + go: "1.22" funlen: lines: 110 statements: 60 From 8efb1b2eadaf63788a0168c91ef2e8b35476d4cb Mon Sep 17 00:00:00 2001 From: Hilmar Falkenberg Date: Mon, 3 Jun 2024 17:47:28 +0200 Subject: [PATCH 2/5] bump go version for nix flake --- flake.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index e6f9d9ddd2..9530eba467 100644 --- a/flake.nix +++ b/flake.nix @@ -3,7 +3,7 @@ inputs = { # NixPkgs (nixos-23.11) - nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05"; }; outputs = { self, nixpkgs, ... }: @@ -28,7 +28,7 @@ inherit (pkgs) stdenv lib ; in { - ${pname} = pkgs.buildGo121Module rec { + ${pname} = pkgs.buildGo122Module rec { inherit pname self; version = lib.fileContents ./VERSION; gitCommit = if (self ? rev) then self.rev else self.dirtyRev; @@ -86,7 +86,7 @@ { default = pkgs.mkShell { buildInputs = with pkgs; [ - go_1_21 # golang 1.21 + go_1_22 # golang 1.22 gopls # go language server gotools # go imports go-tools # static checks From 4232ea979ea23eec5fe204fe08092662ac9ac0de Mon Sep 17 00:00:00 2001 From: Hilmar Falkenberg Date: Mon, 3 Jun 2024 17:47:51 +0200 Subject: [PATCH 3/5] bump golangci/golangci-lint --- hack/install-requirements.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/install-requirements.sh b/hack/install-requirements.sh index ca584ae39e..8cd9103ef0 100755 --- a/hack/install-requirements.sh +++ b/hack/install-requirements.sh @@ -5,7 +5,7 @@ PROJECT_ROOT="${CURRENT_DIR}"/.. echo "> Install Go packages/binaries" -curl -sfL "https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh" | sh -s -- -b $(go env GOPATH)/bin v1.54.2 +curl -sfL "https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh" | sh -s -- -b $(go env GOPATH)/bin v1.58.1 GO111MODULE=off go get -u github.com/go-bindata/go-bindata/... From 308a5f737af64cbfba51ac11fae1cd9dce68a285 Mon Sep 17 00:00:00 2001 From: Gergely Brautigam <182850+Skarlso@users.noreply.github.com> Date: Mon, 3 Jun 2024 22:10:49 +0200 Subject: [PATCH 4/5] updated the version at the right location --- .github/workflows/lint_and_test.yaml | 5 ++--- hack/Makefile | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/lint_and_test.yaml b/.github/workflows/lint_and_test.yaml index b99f28c56e..e9ded1bb91 100644 --- a/.github/workflows/lint_and_test.yaml +++ b/.github/workflows/lint_and_test.yaml @@ -68,7 +68,6 @@ jobs: - name: Setup lint run: | make -f hack/Makefile golangci-lint - #curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.54.2 - name: Lint run: | PATH=$PATH:$(go env GOPATH)/bin make check @@ -79,7 +78,7 @@ jobs: steps: - name: Self Hosted Runner Post Job Cleanup Action uses: TooMuch4U/actions-clean@v2.2 - + - name: Checkout uses: actions/checkout@v4 with: @@ -104,4 +103,4 @@ jobs: - name: Check for diff run: | git diff --exit-code --shortstat - + diff --git a/hack/Makefile b/hack/Makefile index d2de231042..65c028ebe2 100644 --- a/hack/Makefile +++ b/hack/Makefile @@ -10,7 +10,7 @@ else detected_OS := $(shell sh -c 'uname 2>/dev/null || echo Unknown') endif -deps := +deps := # TODO exact versions to compare gSED := $(shell (sed --version 2>/dev/null || echo 0.0) | head -n 1 | sed 's/.*(GNU sed) \([0-9\.]*\).*/\1/') ifeq ("v$(gSED)","v0.0") @@ -33,7 +33,7 @@ ifeq ("v$(JQ)","v0.0") deps += $(detected_OS)_jq endif -GOLANGCILINT_VERSION := "v1.54.2" +GOLANGCILINT_VERSION := "v1.58.1" GOLANGCILINTV := $(shell (golangci-lint --version 2>/dev/null || echo 0.0.0) | sed 's/.*v\([0-9\.]*\) .*/\1/') ifneq ("v$(GOLANGCILINTV)",$(GOLANGCILINT_VERSION)) deps += golangci-lint From d186909b5bd0dc11cccd45af6a5fc73e7430ea1a Mon Sep 17 00:00:00 2001 From: Hilmar Falkenberg Date: Tue, 4 Jun 2024 08:32:43 +0200 Subject: [PATCH 5/5] revert lint changes --- .github/workflows/lint_and_test.yaml | 5 +++-- .golangci.yaml | 6 +++--- hack/Makefile | 4 ++-- hack/install-requirements.sh | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/lint_and_test.yaml b/.github/workflows/lint_and_test.yaml index e9ded1bb91..b99f28c56e 100644 --- a/.github/workflows/lint_and_test.yaml +++ b/.github/workflows/lint_and_test.yaml @@ -68,6 +68,7 @@ jobs: - name: Setup lint run: | make -f hack/Makefile golangci-lint + #curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.54.2 - name: Lint run: | PATH=$PATH:$(go env GOPATH)/bin make check @@ -78,7 +79,7 @@ jobs: steps: - name: Self Hosted Runner Post Job Cleanup Action uses: TooMuch4U/actions-clean@v2.2 - + - name: Checkout uses: actions/checkout@v4 with: @@ -103,4 +104,4 @@ jobs: - name: Check for diff run: | git diff --exit-code --shortstat - + diff --git a/.golangci.yaml b/.golangci.yaml index e31bbcc18c..0d3a603ef4 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -1,5 +1,5 @@ run: - go: "1.22" + go: "1.21" timeout: 10m tests: false allow-parallel-runners: true @@ -109,9 +109,9 @@ linters-settings: - prefix(github.com/open-component-model/ocm) custom-order: true staticcheck: - go: "1.22" + go: "1.21" stylecheck: - go: "1.22" + go: "1.21" funlen: lines: 110 statements: 60 diff --git a/hack/Makefile b/hack/Makefile index 65c028ebe2..d2de231042 100644 --- a/hack/Makefile +++ b/hack/Makefile @@ -10,7 +10,7 @@ else detected_OS := $(shell sh -c 'uname 2>/dev/null || echo Unknown') endif -deps := +deps := # TODO exact versions to compare gSED := $(shell (sed --version 2>/dev/null || echo 0.0) | head -n 1 | sed 's/.*(GNU sed) \([0-9\.]*\).*/\1/') ifeq ("v$(gSED)","v0.0") @@ -33,7 +33,7 @@ ifeq ("v$(JQ)","v0.0") deps += $(detected_OS)_jq endif -GOLANGCILINT_VERSION := "v1.58.1" +GOLANGCILINT_VERSION := "v1.54.2" GOLANGCILINTV := $(shell (golangci-lint --version 2>/dev/null || echo 0.0.0) | sed 's/.*v\([0-9\.]*\) .*/\1/') ifneq ("v$(GOLANGCILINTV)",$(GOLANGCILINT_VERSION)) deps += golangci-lint diff --git a/hack/install-requirements.sh b/hack/install-requirements.sh index 8cd9103ef0..ca584ae39e 100755 --- a/hack/install-requirements.sh +++ b/hack/install-requirements.sh @@ -5,7 +5,7 @@ PROJECT_ROOT="${CURRENT_DIR}"/.. echo "> Install Go packages/binaries" -curl -sfL "https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh" | sh -s -- -b $(go env GOPATH)/bin v1.58.1 +curl -sfL "https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh" | sh -s -- -b $(go env GOPATH)/bin v1.54.2 GO111MODULE=off go get -u github.com/go-bindata/go-bindata/...