2 ms·
Your example matches the _text_, semgrep matches _the language_ given: if 1 \ == \ 1: pass then $ semgrep -e '$X == $X' -l p
by mdaniel 6y ago
Your example matches the _text_, semgrep matches _the language_
given:
if 1 \
== \
1:
pass
then
$ semgrep -e '$X == $X' -l python
1:if 1 \
2: == \
3: 1:
ran 1 rules on 1 files: 1 findings
to follow myself up, one can also check for expressions like what I used as an example and say "don't do that", but without regard to what is inside the if
semgrep -e $'if ...:\n pass\n' -l python