-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update Go linter config and simplify code --------- Co-authored-by: nicolaasuni-vonage <nicola.asuni@vonage.com>
- Loading branch information
1 parent
fa9ad72
commit 5c869b6
Showing
15 changed files
with
3,068 additions
and
2,810 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.6.9 | ||
1.6.10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# https://golangci-lint.run/usage/configuration/ | ||
# To get the list of available linters: ./target/binutil/golangci-lint help linters | ||
|
||
run: | ||
issues-exit-code: 1 | ||
tests: true | ||
timeout: 5m | ||
skip-dirs-use-default: true | ||
|
||
output: | ||
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number" | ||
formats: colored-line-number | ||
|
||
linters-settings: | ||
funlen: | ||
lines: 100 | ||
statements: 50 | ||
ignore-comments: true | ||
gocognit: | ||
min-complexity: 10 | ||
gocyclo: | ||
min-complexity: 10 | ||
gofmt: | ||
simplify: true | ||
misspell: | ||
locale: US | ||
whitespace: | ||
multi-if: false # Enforces newlines (or comments) after every multi-line if statement | ||
multi-func: false # Enforces newlines (or comments) after every multi-line function signature | ||
depguard: | ||
rules: | ||
main: | ||
files: | ||
- $all | ||
- "!$test" | ||
allow: | ||
- $gostd | ||
- github.com/Vonage | ||
test: | ||
files: | ||
- "$test" | ||
allow: | ||
- $gostd | ||
- github.com/stretchr | ||
|
||
issues: | ||
exclude-dirs: | ||
- .github | ||
- .githook | ||
exclude-rules: | ||
- path: _test.go | ||
linters: | ||
- dupl | ||
- funlen | ||
# fix: true | ||
|
||
linters: | ||
enable-all: true | ||
disable: | ||
- depguard # Go linter that checks if package imports are in a list of acceptable packages [fast: true, auto-fix: false] | ||
- execinquery # execinquery is a linter about query string checker in Query function which reads your Go src files and warning it finds [fast: false, auto-fix: false] | ||
- exhaustruct # Checks if all structure fields are initialized [fast: false, auto-fix: false] | ||
- err113 # Go linter to check the errors handling expressions [fast: false, auto-fix: false] | ||
- gomnd # An analyzer to detect magic numbers. [fast: true, auto-fix: false] | ||
- ireturn # Accept Interfaces, Return Concrete Types [fast: false, auto-fix: false] | ||
- lll # Reports long lines [fast: true, auto-fix: false] | ||
- mnd # An analyzer to detect magic numbers. [fast: true, auto-fix: false] | ||
- musttag # enforce field tags in (un)marshaled structs [fast: false, auto-fix: false] | ||
- nlreturn # Accept Nil, Return Non-Nil [fast: false, auto-fix: false] | ||
- tagliatelle # Checks the struct tags. [fast: true, auto-fix: false] | ||
- testpackage # linter that makes you use a separate _test package [fast: true, auto-fix: false] | ||
- varnamelen # checks that the length of a variable's name matches its scope [fast: false, auto-fix: false] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.