Skip to content

Commit 43fe0aa

Browse files
committed
Do not consider issue text in __eq__ method
Issue text is not supposed to be consistent between banndit versions. It was changed few times in the past. That's why we don't need to match text too between issues. This issue is only valid if we compare old bandit baseline generated with the old version with a new one generated using the last bandit.
1 parent 7a2ef1b commit 43fe0aa

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

bandit/core/issue.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,9 @@ def __str__(self):
3636
self.confidence, self.fname, self.lineno)
3737

3838
def __eq__(self, other):
39-
# if the issue text, severity, confidence, and filename match, it's
39+
# if the issue severity, confidence, and filename match, it's
4040
# the same issue from our perspective
41-
match_types = ['text', 'severity', 'confidence', 'fname', 'test',
42-
'test_id']
41+
match_types = ['severity', 'confidence', 'fname', 'test', 'test_id']
4342
return all(getattr(self, field) == getattr(other, field)
4443
for field in match_types)
4544

0 commit comments

Comments
 (0)