mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-10 21:53:57 +08:00
67840cce4b
Commit b2f8a74d "clothed" the naked return as inflicted by gofumpt
v0.9.0. Since gofumpt v0.9.2 this rule was moved to "extra" category,
not enabled by default. The only other "extra" rule is to group adjacent
parameters with the same type, which also makes sense.
Enable gofumpt "extra" rules, and reformat the code accordingly.
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
49 lines
1.3 KiB
YAML
49 lines
1.3 KiB
YAML
version: "2"
|
|
|
|
run:
|
|
build-tags:
|
|
- seccomp
|
|
|
|
formatters:
|
|
enable:
|
|
- gofumpt
|
|
settings:
|
|
gofumpt:
|
|
extra-rules: true
|
|
|
|
linters:
|
|
enable:
|
|
- errorlint
|
|
- forbidigo
|
|
- nolintlint
|
|
- unconvert
|
|
- unparam
|
|
settings:
|
|
govet:
|
|
enable:
|
|
- nilness
|
|
staticcheck:
|
|
checks:
|
|
- all
|
|
- -ST1000 # https://staticcheck.dev/docs/checks/#ST1000 Incorrect or missing package comment.
|
|
- -ST1003 # https://staticcheck.dev/docs/checks/#ST1003 Poorly chosen identifier.
|
|
- -ST1005 # https://staticcheck.dev/docs/checks/#ST1005 Incorrectly formatted error string.
|
|
- -QF1008 # https://staticcheck.dev/docs/checks/#QF1008 Omit embedded fields from selector expression.
|
|
forbidigo:
|
|
forbid:
|
|
# os.Create implies O_TRUNC without O_CREAT|O_EXCL, which can lead to
|
|
# an even more severe attacks than CVE-2024-45310, where host files
|
|
# could be wiped. Always use O_EXCL or otherwise ensure we are not
|
|
# going to be tricked into overwriting host files.
|
|
- pattern: ^os\.Create$
|
|
pkg: ^os$
|
|
analyze-types: true
|
|
exclusions:
|
|
rules:
|
|
# forbidigo lints are only relevant for main code.
|
|
- path: '(.+)_test\.go'
|
|
linters:
|
|
- forbidigo
|
|
presets:
|
|
- std-error-handling
|