mirror of
https://github.com/prometheus/node_exporter.git
synced 2024-12-25 05:34:10 -08:00
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:
|
||||
enable:
|
||||
- depguard
|
||||
- misspell
|
||||
- revive
|
||||
disable:
|
||||
|
@ -19,6 +20,14 @@ issues:
|
|||
- errcheck
|
||||
|
||||
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:
|
||||
exclude-functions:
|
||||
# Used in HTTP handlers, any error is handled by the server itself.
|
||||
|
|
Loading…
Reference in a new issue