diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..0a5fb0b --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,59 @@ +linters-settings: + errcheck: + check-type-assertions: true + goconst: + min-len: 2 + min-occurrences: 3 + gocritic: + enabled-tags: + - diagnostic + - experimental + - opinionated + - performance + - style + govet: + check-shadowing: false + nolintlint: + require-explanation: true + require-specific: true + +linters: + disable-all: true + enable: + - bodyclose + - deadcode + - depguard + - dogsled + - dupl + - errcheck + - exportloopref + - exhaustive + - gocritic + - gofmt + - goimports + - gocyclo + - gosec + - gosimple + - govet + - ineffassign + - nolintlint + - nakedret + - prealloc + - predeclared + - revive + - staticcheck + - structcheck + - stylecheck + - thelper + - tparallel + - typecheck + - unconvert + - unparam + - varcheck + - whitespace + - goconst + - wsl + - misspell + +run: + issues-exit-code: 1 \ No newline at end of file diff --git a/README.md b/README.md index dab0ba2..b7667bf 100644 --- a/README.md +++ b/README.md @@ -303,6 +303,16 @@ Whenever you make changes in the interfaces of these use-cases, repositories, or } ``` +### Linter "must have" +[How to](https://golangci-lint.run/usage/install/) install golangci-lint. His project [main](https://golangci-lint.run/) page. Default config [file](.golangci.yml). +Add to IDE: +- Goland [plugin](https://github.com/xxpxxxxp/intellij-plugin-golangci-lint) +- vscode (ctrl+shift+p -> settings.json): +```json +"go.lintTool": "golangci-lint", +``` + + ### TODO - Improvement based on feedback.