mirror of
https://github.com/portainer/portainer.git
synced 2025-08-04 21:35:23 +02:00
fix(errors): wrap db errors, improve error handling (#8859)
* use error check func, wrap db object not found * add errorlint and fix all the linting errors * add exportloopref linter and fix errors * fix incorrect error details returned on an api * fix new errors * increase linter timeout * increase timeout to 10minutes * increase timeout to 10minutes * rebase and fix new lint errors * make CE match EE * fix govet issue
This commit is contained in:
parent
550e235d59
commit
334eee0c8c
52 changed files with 158 additions and 115 deletions
|
@ -1,8 +1,13 @@
|
|||
linters:
|
||||
# Disable all linters.
|
||||
# Disable all linters, the defaults don't pass on our code yet
|
||||
disable-all: true
|
||||
|
||||
# Enable these for now
|
||||
enable:
|
||||
- depguard
|
||||
- govet
|
||||
- errorlint
|
||||
- exportloopref
|
||||
linters-settings:
|
||||
depguard:
|
||||
list-type: denylist
|
||||
|
@ -13,14 +18,12 @@ linters-settings:
|
|||
packages-with-error-message:
|
||||
- github.com/sirupsen/logrus: 'logging is allowed only by github.com/rs/zerolog'
|
||||
ignore-file-rules:
|
||||
- "**/*_test.go"
|
||||
# Create additional guards that follow the same configuration pattern.
|
||||
# Results from all guards are aggregated together.
|
||||
# additional-guards:
|
||||
# - list-type: allowlist
|
||||
# include-go-root: false
|
||||
# packages:
|
||||
# - github.com/sirupsen/logrus
|
||||
# # Specify rules by which the linter ignores certain files for consideration.
|
||||
# ignore-file-rules:
|
||||
# - "!**/*_test.go"
|
||||
- '**/*_test.go'
|
||||
|
||||
# errorlint is causing a typecheck error for some reason. The go compiler will report these
|
||||
# anyway, so ignore them from the linter
|
||||
issues:
|
||||
exclude-rules:
|
||||
- path: ./
|
||||
linters:
|
||||
- typecheck
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue