-
Notifications
You must be signed in to change notification settings - Fork 372
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(linter): update Golang linter configuration (#1977)
* update golinter + add go sec * add golangci.yml Co-authored-by: @faddat [email protected] * update * update * fix release version * remove sec, update from pr comments, cleanup golangci.yml to not break on master * remove @faddat, not valid codeowner * remove unnecessary make command * remove incorrectly named golangci.yml file * add --new-from-rev * use master instead of main * remove extra echo * set the exports properly * add setup go to work with act * add some docs to golangci linter * test new-from-rev * enable more linters, but app.go back * verify issues-exit-code being gone * put it back * enable more linters * remove exclusions
- Loading branch information
1 parent
5b886b9
commit 6fb9029
Showing
5 changed files
with
143 additions
and
57 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
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,3 @@ | ||
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners | ||
# Global rule: | ||
* @rhuairahrighairidh @karzak @pirtleshell @drklee3 @nddeluca @DracoLi @evgeniy-scherbina @sesheffield |
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 @@ | ||
v1.59 |
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,120 @@ | ||
run: | ||
timeout: 20m # set maximum time allowed for the linter to run. If the linting process exceeds this duration, it will be terminated | ||
modules-download-mode: readonly # Ensures that modules are not modified during the linting process | ||
allow-parallel-runners: true # enables parallel execution of linters to speed up linting process | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
- asasalint | ||
- asciicheck | ||
- bidichk | ||
- bodyclose | ||
- containedctx | ||
- contextcheck | ||
- decorder | ||
- dogsled | ||
# - dupl | ||
# - dupword | ||
- durationcheck | ||
- errcheck | ||
- errchkjson | ||
- errname | ||
- errorlint | ||
# - exhaustive | ||
- exportloopref | ||
- funlen | ||
- gci | ||
- ginkgolinter | ||
- gocheckcompilerdirectives | ||
# - gochecknoglobals | ||
# - gochecknoinits | ||
- goconst | ||
- gocritic | ||
- godox | ||
- gofmt | ||
# - gofumpt | ||
- goheader | ||
- goimports | ||
- mnd | ||
# - gomodguard | ||
- goprintffuncname | ||
# - gosec | ||
- gosimple | ||
- govet | ||
- grouper | ||
- importas | ||
- ineffassign | ||
# - interfacebloat | ||
- lll | ||
- loggercheck | ||
- makezero | ||
- mirror | ||
- misspell | ||
- musttag | ||
# - nakedret | ||
# - nestif | ||
- nilerr | ||
# - nilnil | ||
# - noctx | ||
- nolintlint | ||
# - nonamedreturns | ||
- nosprintfhostport | ||
- prealloc | ||
- predeclared | ||
- promlinter | ||
# - reassign | ||
- revive | ||
- rowserrcheck | ||
- staticcheck | ||
# - stylecheck | ||
- tagalign | ||
# - testpackage | ||
# - thelper | ||
# - tparallel | ||
- typecheck | ||
# - unconvert | ||
- unparam | ||
- unused | ||
# - usestdlibvars | ||
- wastedassign | ||
# - whitespace | ||
- wrapcheck | ||
|
||
|
||
linters-settings: | ||
errcheck: | ||
check-blank: true # check for assignments to the blank identifier '_' when errors are returned | ||
check-type-assertions: false # check type assertion | ||
errorlint: | ||
check-generated: false # disabled linting of generated files | ||
default-signifies-exhaustive: false # exhaustive handling of error types | ||
exhaustive: | ||
default-signifies-exhaustive: false # exhaustive handling of error types | ||
gci: | ||
sections: # defines the order of import sections | ||
- standard | ||
- default | ||
goconst: | ||
min-len: 3 # min length for string constants to be checked | ||
min-occurrences: 3 # min occurrences of the same constant before it's flagged | ||
godox: | ||
keywords: # specific keywords to flag for further action | ||
- BUG | ||
- FIXME | ||
- HACK | ||
lll: | ||
line-length: 120 | ||
nolintlint: | ||
allow-leading-space: false | ||
require-explanation: true | ||
require-specific: true | ||
unparam: | ||
check-exported: true # checks exported functions and methods for unused params | ||
misspell: | ||
locale: US | ||
ignore-words: expect | ||
prealloc: | ||
simple: true # enables simple preallocation checks | ||
range-loops: true # enabled preallocation checks in range loops | ||
for-loops: false # disables preallocation checks in for loops |
This file was deleted.
Oops, something went wrong.