Compare commits
2 Commits
ba09bb4141
...
e5b1f18beb
| Author | SHA1 | Date | |
|---|---|---|---|
| e5b1f18beb | |||
| 513e0c05b2 |
96
.golangci.yml
Normal file
96
.golangci.yml
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
version: "2"
|
||||||
|
|
||||||
|
run:
|
||||||
|
timeout: 5m
|
||||||
|
tests: true
|
||||||
|
modules-download-mode: readonly
|
||||||
|
|
||||||
|
linters:
|
||||||
|
enable:
|
||||||
|
- govet
|
||||||
|
- staticcheck
|
||||||
|
- errcheck
|
||||||
|
- ineffassign
|
||||||
|
- unused
|
||||||
|
- gosec
|
||||||
|
- bodyclose
|
||||||
|
- noctx
|
||||||
|
- sqlclosecheck
|
||||||
|
- revive
|
||||||
|
- gocritic
|
||||||
|
- unparam
|
||||||
|
- wastedassign
|
||||||
|
- durationcheck
|
||||||
|
- goprintffuncname
|
||||||
|
- goconst
|
||||||
|
- misspell
|
||||||
|
- copyloopvar
|
||||||
|
- nilerr
|
||||||
|
|
||||||
|
linters-settings:
|
||||||
|
revive:
|
||||||
|
confidence: 0.8
|
||||||
|
ignore-generated-header: true
|
||||||
|
severity: warning
|
||||||
|
rules:
|
||||||
|
- name: indent-error-flow
|
||||||
|
- name: early-return
|
||||||
|
- name: error-naming
|
||||||
|
- name: var-naming
|
||||||
|
- name: if-return
|
||||||
|
- name: exported
|
||||||
|
- name: context-as-argument
|
||||||
|
- name: errorf
|
||||||
|
- name: unexported-return
|
||||||
|
- name: unnecessary-stmt
|
||||||
|
- name: unreachable-code
|
||||||
|
|
||||||
|
gocritic:
|
||||||
|
disabled-checks:
|
||||||
|
- hugeParam
|
||||||
|
- ifElseChain
|
||||||
|
settings:
|
||||||
|
captLocal:
|
||||||
|
paramsOnly: false
|
||||||
|
|
||||||
|
gosec:
|
||||||
|
excludes:
|
||||||
|
- G204
|
||||||
|
- G601
|
||||||
|
|
||||||
|
errcheck:
|
||||||
|
check-type-assertions: true
|
||||||
|
ignore: |
|
||||||
|
fmt:.*
|
||||||
|
|
||||||
|
staticcheck:
|
||||||
|
checks: ["all"]
|
||||||
|
ignore:
|
||||||
|
- SA1019
|
||||||
|
|
||||||
|
goconst:
|
||||||
|
min-len: 3
|
||||||
|
min-occurrences: 2
|
||||||
|
|
||||||
|
issues:
|
||||||
|
exclude-dirs:
|
||||||
|
- vendor
|
||||||
|
- tmp
|
||||||
|
- dist
|
||||||
|
|
||||||
|
exclude-rules:
|
||||||
|
- path: ".*_test\\.go"
|
||||||
|
linters:
|
||||||
|
- gosec
|
||||||
|
|
||||||
|
- path: "mock/|mocks/"
|
||||||
|
linters:
|
||||||
|
- gosec
|
||||||
|
- revive
|
||||||
|
- errcheck
|
||||||
|
|
||||||
|
max-issues-per-linter: 0
|
||||||
|
max-same-issues: 0
|
||||||
|
|
||||||
|
output:
|
||||||
|
format: colored-line-number
|
||||||
@@ -382,10 +382,12 @@ make fuzz-tests
|
|||||||
# Format code
|
# Format code
|
||||||
make format
|
make format
|
||||||
|
|
||||||
# Run linter
|
# Run linter
|
||||||
make lint
|
make lint
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Note: `golangci-lint` is set up with `.golangci.yml` file.
|
||||||
|
|
||||||
### Regerenate Swagger documentation
|
### Regerenate Swagger documentation
|
||||||
|
|
||||||
If you make changes to the API, you can regenerate the swagger documentation by running the following command after modifying the swagger annotations:
|
If you make changes to the API, you can regenerate the swagger documentation by running the following command after modifying the swagger annotations:
|
||||||
|
|||||||
Reference in New Issue
Block a user