-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configured golangci-lint Configured golangci-lint
- Loading branch information
Showing
101 changed files
with
1,923 additions
and
1,442 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 |
---|---|---|
|
@@ -51,4 +51,4 @@ jobs: | |
- name: Run golangci-lint | ||
uses: golangci/golangci-lint-action@v2 | ||
with: | ||
version: v1.37 | ||
version: latest |
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,10 +1,127 @@ | ||
# Configuration reference: https://golangci-lint.run/usage/configuration/ | ||
# Linters reference: https://golangci-lint.run/usage/linters/ | ||
run: | ||
build-tags: | ||
- examples | ||
skip-dirs: | ||
- apiv6/localhost_apiserver/cloudexport | ||
- apiv6/localhost_apiserver/synthetics | ||
|
||
issues: | ||
max-issues-per-linter: 0 | ||
max-same-issues: 0 | ||
# TODO(dfurman): enable more linters | ||
exclude: | ||
# EXC0002 golint: Annoying issue about not having a comment. The rare codebase has such comments | ||
- (comment on exported (method|function|type|const)|should have( a package)? comment|comment should be of the form) | ||
- (struct (of|with)|could be) | ||
exclude-use-default: false | ||
exclude-rules: # exclude linters impossible to exclude via //nolint | ||
- path: ^kentikapi/models/enum_ # these files are generated and shouldn't be edited with //nolint | ||
linters: | ||
- gochecknoglobals | ||
- lll | ||
- gomnd | ||
|
||
# Disabled linters: | ||
# - cyclop - duplicates functionality of gocyclo | ||
# - exhaustivestruct - breaks "Make the zero value useful" proverb, meant to be used only for special cases | ||
# - funlen - only test functions exceeds the line limit of 60 - too strict, these functions are easily readable | ||
# - godox - requires all TODOs to be removed - too strict | ||
# - gomoddirectives - does not allow "replace" directives - too strict | ||
# - goerr113 - following check is too strict: "do not define dynamic errors, use wrapped static errors instead", | ||
# the check cannot be disabled | ||
# - interfacer - deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner | ||
# - maligned - deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner | ||
# - nlreturn - leads to using too many line breaks | ||
# - prealloc - from docs: | ||
# XXX: we don't recommend using this linter before doing performance profiling. | ||
# For most programs usage of prealloc will be a premature optimization. | ||
# - scopelint - deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner | ||
# - thelper - enforcing t.Helper() everywhere is too strict | ||
# - wrapcheck - valuable linter which I think needs higher level knowledge on the project to be fixed | ||
# - wsl - leads to using too many line breaks | ||
linters: | ||
enable: | ||
- asciicheck | ||
- bodyclose | ||
- deadcode | ||
- depguard | ||
- dogsled | ||
- dupl | ||
- durationcheck | ||
- errcheck | ||
- errorlint | ||
- exhaustive | ||
- exportloopref | ||
- forbidigo | ||
- forcetypeassert | ||
- gci | ||
- gochecknoglobals | ||
- gochecknoinits | ||
- gocognit | ||
- goconst | ||
- gocritic | ||
- gocyclo | ||
- godot | ||
- gofmt | ||
- gofumpt | ||
- goheader | ||
- goimports | ||
- revive | ||
- gomnd | ||
- gomodguard | ||
- goprintffuncname | ||
- gosec | ||
- gosimple | ||
- govet | ||
- ifshort | ||
- importas | ||
- ineffassign | ||
- lll | ||
- makezero | ||
- misspell | ||
- nakedret | ||
- nestif | ||
- nilerr | ||
- noctx | ||
- nolintlint | ||
- paralleltest | ||
- predeclared | ||
- revive | ||
- rowserrcheck | ||
- sqlclosecheck | ||
- staticcheck | ||
- structcheck | ||
- stylecheck | ||
- testpackage | ||
- tparallel | ||
- typecheck | ||
- unconvert | ||
- unparam | ||
- unused | ||
- varcheck | ||
- wastedassign | ||
- whitespace | ||
|
||
linters-settings: | ||
dupl: | ||
tests: false | ||
errcheck: | ||
check-type-assertions: true | ||
check-blank: true | ||
errorlint: | ||
# Check whether fmt.Errorf uses the %w verb for formatting errors - too strict | ||
errorf: false | ||
gocyclo: | ||
min-complexity: 11 | ||
golint: | ||
min-confidence: 0 | ||
gosec: | ||
tests: false | ||
govet: | ||
enable-all: true | ||
lll: | ||
# lines longer than 127 will be reported, 120 is default | ||
line-length: 127 | ||
nakedret: | ||
max-func-lines: 5 |
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
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
Oops, something went wrong.