From 880744f280c5be134e690c4d6f7398a5661eec89 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 15 Mar 2023 20:08:58 +0100 Subject: [PATCH] p3: add .golangci-lint --- p3/.golangci.yml | 100 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 p3/.golangci.yml diff --git a/p3/.golangci.yml b/p3/.golangci.yml new file mode 100644 index 0000000..23f01dd --- /dev/null +++ b/p3/.golangci.yml @@ -0,0 +1,100 @@ +--- +run: + go: 1.19.2 + tests: true + +issues: + max-issues-per-linter: 0 + max-same-issues: 0 + +linters: + enable: + - bidichk + # - dupl + # The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner + # seems to have abandoned the linter. Replaced by unused. + # - deadcode + - decorder + - dogsled + - exportloopref + - forbidigo + - gas + - gocognit + - goconst + - gocritic + - godot + - govet + - gofmt + - gofumpt + - goimports + - goprintffuncname + - gosec + - ineffassign + # The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository + # of the linter has been deprecated by the owner. + # - ifshort + - misspell + # - prealloc + - revive + - tparallel + - unconvert + - unparam + - unused + # The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner + # seems to have abandoned the linter. Replaced by unused. + # - varcheck + - wastedassign + - whitespace + - wsl + +linter-settings: + dupl: + threshold: 100 + gocritic: + enabled-tags: + - diagnostic + - experimental + - opinionated + - performance + - style + disabled-checks: + - dupImport # https://github.com/go-critic/go-critic/issues/845 + - ifElseChain + - octalLiteral + - whyNoLint + - wrapperFunc + gocyclo: + min-complexity: 15 + gofumpt: + extra-rules: true + lang-version: "1.18" + govet: + check-shadowing: true + revive: + severity: warning + confidence: 0.8 + errorCode: 1 + warningCode: 1 + rules: + - name: blank-imports + - name: context-as-argument + - name: context-keys-type + - name: dot-imports + - name: error-return + - name: error-strings + - name: error-naming + - name: exported + - name: if-return + - name: increment-decrement + - name: var-naming + - name: var-declaration + - name: package-comments + - name: range + - name: receiver-naming + - name: time-naming + - name: unexported-return + - name: indent-error-flow + - name: errorf + - name: duplicated-imports + - name: modifies-value-receiver +...