-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update golangci-lint and add a configuration file which makes it much more strict. Bump version of go so we get all the latest linters.
- Loading branch information
Showing
3 changed files
with
86 additions
and
6 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
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,83 @@ | ||
run: | ||
timeout: 2m | ||
|
||
linters-settings: | ||
gosec: | ||
excludes: | ||
- G601 ## Implicit memory aliasing of items from a range statement - not possible in go 1.22. | ||
cyclop: | ||
max-complexity: 15 | ||
nestif: | ||
min-complexity: 10 | ||
govet: | ||
settings: | ||
shadow: | ||
strict: true | ||
enable-all: true | ||
nolintlint: | ||
require-explanation: true | ||
godot: | ||
scope: all | ||
|
||
linters: | ||
enable-all: true | ||
disable: | ||
# Spammy / low value | ||
- varnamelen | ||
- exhaustruct | ||
- nlreturn | ||
- wsl | ||
- lll | ||
- paralleltest | ||
# Duplicate functionality. | ||
- funlen | ||
- gocognit | ||
# Deprecated. | ||
- execinquery | ||
- gomnd | ||
# Good but gets in the way too often. | ||
- testpackage | ||
# Unknown details about how Artemis works are flagged with TODO's. | ||
- godox | ||
# Seems to be broken. | ||
- depguard | ||
# Makes it messy for multiple optional tags. | ||
- tagalign | ||
# Not needed for go 1.22+. | ||
- exportloopref | ||
- errchkjson # Duplicate functionality for errcheck. | ||
|
||
issues: | ||
include: | ||
- EXC0012 | ||
- EXC0014 | ||
exclude-rules: | ||
# Exclude linters which aren't an issue in tests. | ||
- path: _test\.go | ||
linters: | ||
- gochecknoglobals | ||
- wrapcheck | ||
|
||
# File mode permissions are fine for constants. | ||
- text: "Magic number: 0o\\d+" | ||
linters: | ||
- mnd | ||
|
||
# Field alignment in tests isn't a performance issue. | ||
- text: fieldalignment | ||
path: _test\.go | ||
|
||
# Dynamic errors can provide useful context. | ||
- text: "do not define dynamic errors, use wrapped static errors instead:" | ||
linters: | ||
- err113 | ||
|
||
# We need to use the `err` named return for error handling. | ||
- text: 'named return "err" with type "error" found' | ||
linters: | ||
- nonamedreturns | ||
|
||
# Interface casting is fine in mock. | ||
- path: mock_test\.go | ||
linters: | ||
- forcetypeassert |
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