From a63ae1831d1f9da11b68e2be5a3beb9663db47f7 Mon Sep 17 00:00:00 2001 From: "Marcel S. Henselin" Date: Mon, 2 Mar 2026 09:00:16 +0100 Subject: [PATCH] fix: fix golangci-lint file name --- .github/workflows/ci.yaml | 2 +- golang-ci.yaml => .golang-ci.yaml | 0 Makefile | 2 +- golang-ci.yaml.bak | 97 +++++++++++++++++++++++++++++++ 4 files changed, 99 insertions(+), 2 deletions(-) rename golang-ci.yaml => .golang-ci.yaml (100%) create mode 100644 golang-ci.yaml.bak diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 94c549a7..43666bda 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -206,7 +206,7 @@ jobs: uses: golangci/golangci-lint-action@v9 with: version: v2.10 - args: --config=golang-ci.yaml --allow-parallel-runners --timeout=5m + args: --config=.golang-ci.yaml --allow-parallel-runners --timeout=5m continue-on-error: true - name: Linting terraform files diff --git a/golang-ci.yaml b/.golang-ci.yaml similarity index 100% rename from golang-ci.yaml rename to .golang-ci.yaml diff --git a/Makefile b/Makefile index 0c902fea..8b74e830 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ project-tools: # LINT lint-golangci-lint: @echo "Linting with golangci-lint" - @go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint run --fix --config golang-ci.yaml + @go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint run --fix --config .golang-ci.yaml lint-tf: diff --git a/golang-ci.yaml.bak b/golang-ci.yaml.bak new file mode 100644 index 00000000..11f74066 --- /dev/null +++ b/golang-ci.yaml.bak @@ -0,0 +1,97 @@ + +version: "2" +run: + concurrency: 4 +output: + formats: + text: + print-linter-name: true + print-issued-lines: true + colors: true + path: stdout +linters: + enable: + - bodyclose + - depguard + - errorlint + - forcetypeassert + - gochecknoinits + - gocritic + - gosec + - misspell + - nakedret + - revive + - sqlclosecheck + - wastedassign + disable: + - noctx + - unparam + settings: + depguard: + rules: + main: + list-mode: lax + allow: + - tf-provider.git.onstackit.cloud/stackit-dev-tools/terraform-provider-stackitprivatepreview + - github.com/hashicorp/terraform-plugin-framework + - github.com/hashicorp/terraform-plugin-log + - github.com/stackitcloud/stackit-sdk-go + deny: + - pkg: github.com/stretchr/testify + desc: Do not use a testing framework + gocritic: + disabled-checks: + - wrapperFunc + - typeDefFirst + - ifElseChain + - dupImport + - hugeParam + enabled-tags: + - performance + - style + - experimental + gosec: + excludes: + - G104 + - G102 + - G304 + - G307 + misspell: + locale: US + nakedret: + max-func-lines: 0 + revive: + severity: error + rules: + - name: errorf + - name: context-as-argument + - name: error-return + - name: increment-decrement + - name: indent-error-flow + - name: superfluous-else + - name: unused-parameter + - name: unreachable-code + - name: atomic + - name: empty-lines + - name: early-return + exclusions: + paths: + - stackit-sdk-generator/ + - generated/ + - pkg_gen/ + generated: lax + warn-unused: true + # Excluding configuration per-path, per-linter, per-text and per-source. + rules: + # Exclude some linters from running on tests files. + - path: _test\.go + linters: + - gochecknoinits +formatters: + enable: + - gofmt + - goimports + settings: + goimports: + local-prefixes: + - tf-provider.git.onstackit.cloud/stackit-dev-tools/terraform-provider-stackitprivatepreview \ No newline at end of file