mirror of
https://github.com/anchore/syft.git
synced 2026-07-04 18:18:26 +02:00
golangci-lint: enable gci formatter (#4828)
This allows linting the imports to be grouped correctly, and provides an auto-fix (`golangci-lint run --fix`). Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
951fbd454a
commit
b70fa899cb
@ -70,7 +70,6 @@ linters:
|
|||||||
# - godot
|
# - godot
|
||||||
# - godox
|
# - godox
|
||||||
# - goerr113
|
# - goerr113
|
||||||
# - goimports # we're using gosimports now instead to account for extra whitespaces (see https://github.com/golang/go/issues/20818)
|
|
||||||
# - golint # deprecated
|
# - golint # deprecated
|
||||||
# - gomnd # this is too aggressive
|
# - gomnd # this is too aggressive
|
||||||
# - interfacer # this is a good idea, but is no longer supported and is prone to false positives
|
# - interfacer # this is a good idea, but is no longer supported and is prone to false positives
|
||||||
@ -96,11 +95,18 @@ issues:
|
|||||||
|
|
||||||
formatters:
|
formatters:
|
||||||
enable:
|
enable:
|
||||||
|
- gci
|
||||||
- gofmt
|
- gofmt
|
||||||
- goimports
|
|
||||||
exclusions:
|
exclusions:
|
||||||
generated: lax
|
generated: lax
|
||||||
paths:
|
paths:
|
||||||
- third_party$
|
- third_party$
|
||||||
- builtin$
|
- builtin$
|
||||||
- examples$
|
- examples$
|
||||||
|
settings:
|
||||||
|
gci:
|
||||||
|
# See https://golangci-lint.run/docs/formatters/configuration/#gci
|
||||||
|
sections:
|
||||||
|
- standard # Standard section: captures all standard packages.
|
||||||
|
- default # Default section: contains all imports that could not be matched to another section type.
|
||||||
|
- prefix(github.com/anchore)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user