Enforce no subprocess policy (#2926)
Add depguard to golangci-lint to enforce the no-os/exec policy. Signed-off-by: Ben Kochie <superq@gmail.com>
This commit is contained in:
parent
9f9473859b
commit
09014c0c5c
|
@ -1,5 +1,6 @@
|
||||||
linters:
|
linters:
|
||||||
enable:
|
enable:
|
||||||
|
- depguard
|
||||||
- misspell
|
- misspell
|
||||||
- revive
|
- revive
|
||||||
disable:
|
disable:
|
||||||
|
@ -19,6 +20,14 @@ issues:
|
||||||
- errcheck
|
- errcheck
|
||||||
|
|
||||||
linters-settings:
|
linters-settings:
|
||||||
|
depguard:
|
||||||
|
rules:
|
||||||
|
no_exec_policy:
|
||||||
|
files:
|
||||||
|
- "!$test"
|
||||||
|
deny:
|
||||||
|
- pkg: "os/exec"
|
||||||
|
desc: "Using os/exec to run sub processes it not allowed by policy"
|
||||||
errcheck:
|
errcheck:
|
||||||
exclude-functions:
|
exclude-functions:
|
||||||
# Used in HTTP handlers, any error is handled by the server itself.
|
# Used in HTTP handlers, any error is handled by the server itself.
|
||||||
|
|
Loading…
Reference in New Issue