From 0626b9d1ddde6d5e19407b09be758d2633458ae9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Apr 2025 05:00:06 +0000 Subject: [PATCH 1/2] Bump golangci/golangci-lint-action from 6 to 7 Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 6 to 7. - [Release notes](https://github.com/golangci/golangci-lint-action/releases) - [Commits](https://github.com/golangci/golangci-lint-action/compare/v6...v7) --- updated-dependencies: - dependency-name: golangci/golangci-lint-action dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1b5dbd8..694ca6b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,6 +77,6 @@ jobs: working-directory: ./scraper - name: Lint go - uses: golangci/golangci-lint-action@v6 + uses: golangci/golangci-lint-action@v7 with: working-directory: ./scraper From f7f0d3d094c073764656e6b62689bce4c800171d Mon Sep 17 00:00:00 2001 From: TuxCoding <1957196+TuxCoding@users.noreply.github.com> Date: Thu, 10 Apr 2025 14:16:24 +0200 Subject: [PATCH 2/2] Migrate config for new golangci --- scraper/.golangci.yml | 97 ++++++++++++++++++++++++++----------------- 1 file changed, 60 insertions(+), 37 deletions(-) diff --git a/scraper/.golangci.yml b/scraper/.golangci.yml index 0bf2569..0290f12 100644 --- a/scraper/.golangci.yml +++ b/scraper/.golangci.yml @@ -1,47 +1,70 @@ +version: "2" + run: - # Set to container quota - concurrency: 0 - timeout: 60s + # Allow multiple runners in CI allow-parallel-runners: true +# Specific linter settings linters: - enable-all: true + default: all disable: - # requires whitespaces even though for statements and assignments are common or used within loops - - wsl - # Requires nl before return - - nlreturn - # Allow unused stuff, because it's could enabled easily - - unused + # No forbidden deps + - depguard # fmt print is explicitly allowed as a script - forbidigo # Comments do not require dot or capital - godot - # No forbidden deps - - depguard - # Deprecated - - tenv + # Requires nl before return + - nlreturn + # Allow unused stuff, because it's could enabled easily + - unused + # requires whitespaces even though for statements and assignments are common or used within loops + - wsl + settings: + revive: + confidence: 0.1 + enable-all-rules: true + rules: + # Ignore formatting errors + - name: unhandled-error + arguments: + - fmt.Printf + - name: add-constant + arguments: + # Allow -1 and empty strings for checks like LastIndex != -1 + - allowInts: 0,1 + allowStrs: '""' + # Allow panics on this script + - name: deep-exit + disabled: true + - name: line-length-limit + arguments: + # 80 line length is not necessary anymore for todays standard + - 120 + - name: cognitive-complexity + arguments: + - 14 + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + paths: + - third_party$ + - builtin$ + - examples$ -# Specific linter settings -linters-settings: - revive: - enable-all-rules: true - confidence: 0.1 - rules: - # Ignore formatting errors - - name: unhandled-error - arguments: - - "fmt.Printf" - - name: add-constant - arguments: - # Allow -1 and empty strings for checks like LastIndex != -1 - - allowInts: "0,1" - allowStrs: '""' - # Allow panics on this script - - name: deep-exit - disabled: true - # 80 line length is not necessary anymore for todays standard - - name: line-length-limit - arguments: [ 120 ] - - name: cognitive-complexity - arguments: [14] +formatters: + enable: + - gci + - gofmt + - gofumpt + - goimports + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$