semgrep icon indicating copy to clipboard operation
semgrep copied to clipboard

Add option to use semgrepignore and exclude/include mechanisms on explicit targets

Open mjambon opened this issue 2 years ago • 1 comments

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.

mjambon avatar Jan 25 '23 04:01 mjambon

And at some point this should be the default.

aryx avatar Jan 25 '23 12:01 aryx