Browse Source

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>
pull/2932/head
Ben Kochie 9 months ago committed by GitHub
parent
commit
09014c0c5c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 9
      .golangci.yml

9
.golangci.yml

@ -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…
Cancel
Save