reference Flags

--vim-output

Accepted by
opengrep scan, opengrep ci
Value
FILE
See also
--vim, --output

Writes the lines that --vim prints, one per finding, to FILE, in addition to the output on standard output. In Vim, :cfile FILE loads the file as a quickfix list.

The flag can be repeated to write several files. The file is written even when the scan finds nothing; it is then empty.

Examples

A quickfix file

rule.yaml
rules:  - id: find-eval    pattern: eval(...)    message: found eval    languages: [python]    severity: WARNING
app.py
eval(1)
Command and result
$ opengrep scan --config rule.yaml --vim-output quickfix.txt app.py > /dev/null 2>&1
$ cat quickfix.txt
app.py:1:1:W:find-eval:found eval