semgrep
semgrep copied to clipboard
Add option to use semgrepignore and exclude/include mechanisms on explicit targets
Is your feature request related to a problem? Please describe.
A pre-commit hook that runs semgrep will pass explicit target files to semgrep. This overrides any exclusions made by the .semgrepignore file(s) or by the --include or --exclude options passed to semgrep.
Describe the solution you'd like
Add a flag --force-exclusions or similar that doesn't cause the exclusion mechanisms to be disabled on explicit targets, i.e. treat explicit targets as not explicit.
Use case
Run semgrep CLI on repos using pre-commit.
And at some point this should be the default.