mirror of
https://github.com/Icinga/icingadb.git
synced 2025-12-18 23:16:16 -05:00
golangci-lint: Add .golangci.yml configuration
Initialize a .golangci.yml configuration file based on the configuration
file from Icinga Notifications[0].
[0]: 272ecf231f/.golangci.yml
This commit is contained in:
parent
7aa4cde4ec
commit
f1956fd9a1
2 changed files with 31 additions and 3 deletions
3
.github/workflows/go.yml
vendored
3
.github/workflows/go.yml
vendored
|
|
@ -39,9 +39,6 @@ jobs:
|
|||
version: latest
|
||||
only-new-issues: true
|
||||
|
||||
# Enable the gosec linter w/o having to create a .golangci.yml config
|
||||
args: -E gosec
|
||||
|
||||
vet:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
|
|
|||
31
.golangci.yml
Normal file
31
.golangci.yml
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
version: "2"
|
||||
|
||||
linters:
|
||||
default: standard
|
||||
|
||||
enable:
|
||||
- bidichk # dangerous Unicode chars
|
||||
- bodyclose # HTTP response body is closed
|
||||
- exptostd # functions from golang.org/x/exp/ that can be replaced by std functions
|
||||
- forcetypeassert # forced type assertions
|
||||
- gosec # security problems
|
||||
- loggercheck # key value pairs for common logger libraries (including zap)
|
||||
- misspell # commonly misspelled English words
|
||||
- nosprintfhostport # misuse of Sprintf to construct a host with port in a URL
|
||||
- rowserrcheck # Rows.Err of rows is checked
|
||||
- sqlclosecheck # sql.Rows, sql.Stmt, sqlx.NamedStmt, pgx.Query are closed
|
||||
|
||||
settings:
|
||||
staticcheck:
|
||||
checks:
|
||||
- all
|
||||
- '-QF1001' # don't suggest De Morgan's law for boolean expressions
|
||||
- '-QF1003' # ignore could use tagged switch
|
||||
- '-QF1008' # ignore could remove embedded field
|
||||
- '-ST1000' # ignore missing package comments
|
||||
- '-ST1003' # ignore capitalization in camel case names
|
||||
- '-ST1005' # ignore capitalized error strings
|
||||
|
||||
issues:
|
||||
max-issues-per-linter: 0
|
||||
max-same-issues: 0
|
||||
Loading…
Reference in a new issue