Skip to content

Commit

Permalink
Add code from PR amitshekhariitbhu#11 - Add linter config file add de…
Browse files Browse the repository at this point in the history
…scription
  • Loading branch information
Yuri-SN committed Aug 27, 2023
1 parent d250fe0 commit 0a91abc
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,15 @@ 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.
Expand Down

0 comments on commit 0a91abc

Please sign in to comment.