From e264a9cbe138429be40e22da53f7f2da9e4515a3 Mon Sep 17 00:00:00 2001 From: Sean Murphy Date: Wed, 7 Sep 2022 16:28:53 -0400 Subject: [PATCH] Testing semgrep --- vulnerable-file.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 vulnerable-file.py diff --git a/vulnerable-file.py b/vulnerable-file.py new file mode 100644 index 0000000000..a4877805a1 --- /dev/null +++ b/vulnerable-file.py @@ -0,0 +1,21 @@ +# ruleid:useless-eqeq +x == x + +def __eq__(self, other): + # OK; skip most things that are inside eqs based on what we saw on platform + return self == self and self == other + +def sure(ofcourse): + return 1 == 1 + +class A: + def __eq__(self, other): + # OK; skip most things that are inside eqs based on what we saw on platform + return self == self and self == other + + +assert(x == x) +assert x == x +assert x == x, "of course" +assertTrue(x ==x) +assertFalse(x == x)