reference Flags

--files-with-matches

Accepted by
opengrep scan, opengrep ci
See also
--emacs, --vim, --json, --output

Replaces the output with the list of files that have at least one finding, one path per line, as grep -l does.

Examples

The files, not the findings

rule.yaml
rules:  - id: find-eval    pattern: eval(...)    message: found eval    languages: [python]    severity: WARNING
app.py
eval(1)
clean.py
print(1)
Command and result
$ opengrep scan -q --config rule.yaml --files-with-matches .
app.py