pomerium/.golangci.yml
Caleb Doxsey a2fd95aae6
core/ci: update linting (#4844)
* core/ci: update linting

* re-add exportloopref

* re-add gocheckcompilerdirectives

* re-add stylecheck

* re-add usestdlibvars

* upgrade lint

---------

Co-authored-by: Denis Mishin <dmishin@pomerium.com>
2023-12-14 09:07:54 -08:00

78 lines
1.8 KiB
YAML

run:
deadline: 20m
linters-settings:
gci:
custom-order: true
sections:
- standard
- default
- prefix(github.com/pomerium)
linters:
disable-all: true
enable:
- asasalint
- bodyclose
- dogsled
- errcheck
- errorlint
- exportloopref
- gci
- gocheckcompilerdirectives
- gofumpt
- goimports
- goprintffuncname
- gosec
- gosimple
- govet
- ineffassign
- misspell
- nakedret
- nolintlint
- revive
- staticcheck
- stylecheck
- tenv
- unconvert
- unused
- usestdlibvars
issues:
# List of regexps of issue texts to exclude, empty list by default.
# But independently from this option we use default exclude patterns,
# it can be disabled by `exclude-use-default: false`. To list all
# excluded by default patterns execute `golangci-lint run --help`
exclude:
## Defaults we want from golangci-lint
# errcheck: Almost all programs ignore errors on these functions and in most cases it's ok
- Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*printf?|os\.(Un)?Setenv). is not checked
- empty-block
# go sec : we want to allow skipping tls auth
- "TLS InsecureSkipVerify set true."
- "SA1019"
exclude-rules:
# Exclude some linters from running on test files.
- path: _test\.go$|^tests/|^integration/|^samples/|templates\.go$
linters:
- bodyclose
- errcheck
- gomnd
- gosec
- lll
- maligned
- staticcheck
- unparam
- unused
- scopelint
- gosec
- gosimple
- path: internal/identity/oauth/github/github.go
text: "Potential hardcoded credentials"
linters:
- gosec
- text: "G112:"
linters:
- gosec