Skip to content

Commit 0a91abc

Browse files
committed
Add code from PR amitshekhariitbhu#11 - Add linter config file add description
1 parent d250fe0 commit 0a91abc

File tree

2 files changed

+68
-0
lines changed

2 files changed

+68
-0
lines changed

.golangci.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
linters-settings:
2+
errcheck:
3+
check-type-assertions: true
4+
goconst:
5+
min-len: 2
6+
min-occurrences: 3
7+
gocritic:
8+
enabled-tags:
9+
- diagnostic
10+
- experimental
11+
- opinionated
12+
- performance
13+
- style
14+
govet:
15+
check-shadowing: false
16+
nolintlint:
17+
require-explanation: true
18+
require-specific: true
19+
20+
linters:
21+
disable-all: true
22+
enable:
23+
- bodyclose
24+
- deadcode
25+
- depguard
26+
- dogsled
27+
- dupl
28+
- errcheck
29+
- exportloopref
30+
- exhaustive
31+
- gocritic
32+
- gofmt
33+
- goimports
34+
- gocyclo
35+
- gosec
36+
- gosimple
37+
- govet
38+
- ineffassign
39+
- nolintlint
40+
- nakedret
41+
- prealloc
42+
- predeclared
43+
- revive
44+
- staticcheck
45+
- structcheck
46+
- stylecheck
47+
- thelper
48+
- tparallel
49+
- typecheck
50+
- unconvert
51+
- unparam
52+
- varcheck
53+
- whitespace
54+
- goconst
55+
- wsl
56+
- misspell
57+
58+
run:
59+
issues-exit-code: 1

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,15 @@ Whenever you make changes in the interfaces of these use-cases, repositories, or
312312
}
313313
```
314314

315+
### Linter "must have"
316+
[How to](https://golangci-lint.run/usage/install/) install golangci-lint. His project [main](https://golangci-lint.run/) page. Default config [file](.golangci.yml).
317+
Add to IDE:
318+
- Goland [plugin](https://github.com/xxpxxxxp/intellij-plugin-golangci-lint)
319+
- vscode (ctrl+shift+p -> settings.json):
320+
```json
321+
"go.lintTool": "golangci-lint",
322+
```
323+
315324
### TODO
316325

317326
- Improvement based on feedback.

0 commit comments

Comments
 (0)