reference Flags

--enable-nosem

Accepted by
opengrep scan, opengrep ci
Also spelled
--disable-nosem
Default
true
See also
--opengrep-ignore-pattern, --exclude-rule

A comment that starts with nosem, nosemgrep or noopengrep, at the end of a line, suppresses the findings on that line. This is the default; --enable-nosem requests it explicitly.

--disable-nosem reports these findings as well. --opengrep-ignore-pattern adds a prefix to the three built-in ones.

Examples

Reporting the findings that a nosem comment suppresses

rule.yaml
rules:  - id: find-eval    pattern: eval(...)    message: found eval    languages: [python]    severity: WARNING
app.py
eval(1)  # nosemeval(2)
Command and result
$ opengrep scan -q --config rule.yaml app.py
app.py

  warn  find-eval
  found eval

     2: eval(2)
$ opengrep scan -q --config rule.yaml --disable-nosem app.py
app.py

  warn  find-eval
  found eval

     1: eval(1)  # nosem

     2: eval(2)