diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index e1a2397d1..1394aa053 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -7,8 +7,6 @@ jobs: lint: name: Linter runs-on: ubuntu-latest - # TODO: Remove continue-on-error once linter issues are fixed - continue-on-error: true steps: - name: Checkout uses: actions/checkout@v6 @@ -29,7 +27,7 @@ jobs: with: version: latest - # TODO: Remove once linter job is required + # TODO: Remove once linter is properly configured fmt-check: name: Formatting runs-on: ubuntu-latest @@ -47,7 +45,7 @@ jobs: make fmt git diff --exit-code || (echo "::error::Code is not formatted. Run 'make fmt' and commit the changes." && exit 1) - # TODO: Remove once linter job is required + # TODO: Remove once linter is properly configured vet: name: Vet runs-on: ubuntu-latest diff --git a/.golangci.yaml b/.golangci.yaml index 4d8435fff..80e54ac1c 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -26,6 +26,52 @@ linters: - wrapcheck - wsl - wsl_v5 + + # TODO: Disabled, because they are failing at the moment, we should fix them and enable (step by step) + - bodyclose + - contextcheck + - dogsled + - embeddedstructfieldcheck + - errcheck + - errchkjson + - errorlint + - exhaustive + - forbidigo + - forcetypeassert + - funlen + - gochecknoinits + - gocognit + - goconst + - gocritic + - gocyclo + - godox + - goprintffuncname + - gosec + - govet + - ineffassign + - lll + - maintidx + - misspell + - mnd + - modernize + - nakedret + - nestif + - nilnil + - paralleltest + - perfsprint + - prealloc + - predeclared + - revive + - staticcheck + - tagalign + - testifylint + - thelper + - unparam + - unused + - usestdlibvars + - usetesting + - wastedassign + - whitespace settings: errcheck: check-type-assertions: true @@ -114,10 +160,12 @@ issues: formatters: enable: - - gci - - gofmt - - gofumpt - goimports + # TODO: Disabled, because they are failing at the moment, we should fix them and enable (step by step) + # - gci + # - gofmt + # - gofumpt + # - golines settings: gci: sections: @@ -126,8 +174,11 @@ formatters: - localmodule custom-order: true gofmt: + simplify: true rewrite-rules: - pattern: "interface{}" replacement: "any" - pattern: "a[b:len(a)]" replacement: "a[b:]" + golines: + max-len: 120