forked from vaguecoder/gorilla-mux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- added .golangci.yaml file Signed-off-by: Tanryberdi <tanryberdi@gmail.com> See vaguecoder#4
- Loading branch information
1 parent
609264b
commit e5d9dec
Showing
10 changed files
with
104 additions
and
25 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 |
---|---|---|
@@ -0,0 +1,63 @@ | ||
run: | ||
timeout: 3m | ||
|
||
linters-settings: | ||
cyclop: | ||
max-complexity: 30 | ||
nolintlint: | ||
allow-unused: true | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
- gosimple # specializes in simplifying a code | ||
- govet # reports suspicious constructs, such as Printf calls whose arguments do not align with the format string | ||
- ineffassign # detects when assignments to existing variables are not used | ||
- staticcheck # is a go vet on steroids, applying a ton of static analysis checks | ||
- typecheck # like the front-end of a Go compiler, parses and type-checks Go code | ||
- unused # checks for unused constants, variables, functions and types | ||
- asasalint # checks for pass []any as any in variadic func(...any) | ||
- asciicheck # checks that your code does not contain non-ASCII identifiers | ||
- bidichk # checks for dangerous unicode character sequences | ||
- bodyclose # checks whether HTTP response body is closed successfully | ||
- cyclop # checks function and package cyclomatic complexity | ||
- dupl # tool for code clone detection | ||
- durationcheck # checks for two durations multiplied together | ||
- errname # checks that sentinel errors are prefixed with the Err and error types are suffixed with the Error | ||
- execinquery # checks query string in Query function which reads your Go src files and warning it finds | ||
- exhaustive # checks exhaustiveness of enum switch statements | ||
- exportloopref # checks for pointers to enclosing loop variables | ||
- forbidigo # forbids identifiers | ||
- gochecknoinits # checks that no init functions are present in Go code | ||
- gocyclo # computes and checks the cyclomatic complexity of functions | ||
- goimports # in addition to fixing imports, goimports also formats your code in the same style as gofmt | ||
- gomodguard # allow and block lists linter for direct Go module dependencies. This is different from depguard where there are different block types for example version constraints and module recommendations | ||
- goprintffuncname # checks that printf-like functions are named with f at the end | ||
- gosec # inspects source code for security problems | ||
- loggercheck # checks key value pairs for common logger libraries (kitlog,klog,logr,zap) | ||
- makezero # finds slice declarations with non-zero initial length | ||
- nakedret # finds naked returns in functions greater than a specified function length | ||
- nilerr # finds the code that returns nil even if it checks that the error is not nil | ||
- nilnil # checks that there is no simultaneous return of nil error and an invalid value | ||
- noctx # finds sending http request without context.Context | ||
- nolintlint # reports ill-formed or insufficient nolint directives | ||
- nonamedreturns # reports all named returns | ||
- nosprintfhostport # checks for misuse of Sprintf to construct a host with port in a URL | ||
- predeclared # finds code that shadows one of Go's predeclared identifiers | ||
- promlinter # checks Prometheus metrics naming via promlint | ||
- reassign # checks that package variables are not reassigned | ||
- revive # fast, configurable, extensible, flexible, and beautiful linter for Go, drop-in replacement of golint | ||
- rowserrcheck # checks whether Err of rows is checked successfully | ||
- sqlclosecheck # checks that sql.Rows and sql.Stmt are closed | ||
- stylecheck # is a replacement for golint | ||
- tenv # detects using os.Setenv instead of t.Setenv since Go1.17 | ||
- unconvert # removes unnecessary type conversions | ||
- wastedassign # finds wasted assignment statements | ||
- whitespace # detects leading and trailing whitespace | ||
|
||
issues: | ||
exclude-rules: | ||
- path: "_test\\.go" | ||
linters: | ||
- bodyclose | ||
- noctx |
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
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
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