> You need to enable JavaScript to run this app.
Wait, is this a web app? I was expecting a command line tool to navigate my code locally.
Wait, is this a web app? I was expecting a command line tool to navigate my code locally.
You can write stuff like
# Check for Python == where the left and right hand sides are the same (often a bug)
$ semgrep -e '$X == $X' --lang=py path/to/src grep -E '(.+) = \1' *.py
I have trouble looking at the examples in the project website (many things inside iframes are adblocked). Do you have any example of a search that would be difficult or impossible with grep?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 import random
y = 0
def f(x):
print(x)
if random.randint(0,1) == 2:
y = 1
f(y)
This not only fails but crashes the program.