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:
Ben Kochie 2024-02-16 09:41:06 +01:00 committed by GitHub
parent 9f9473859b
commit 09014c0c5c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 0 deletions

View File

@ -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.