Skip to content

Commit

Permalink
Do not consider issue text in __eq__ method
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
e0ne committed Feb 8, 2020
1 parent 7a2ef1b commit 43fe0aa
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions bandit/core/issue.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@ def __str__(self):
self.confidence, self.fname, self.lineno)

def __eq__(self, other):
# if the issue text, severity, confidence, and filename match, it's
# if the issue severity, confidence, and filename match, it's
# the same issue from our perspective
match_types = ['text', 'severity', 'confidence', 'fname', 'test',
'test_id']
match_types = ['severity', 'confidence', 'fname', 'test', 'test_id']
return all(getattr(self, field) == getattr(other, field)
for field in match_types)

Expand Down

0 comments on commit 43fe0aa

Please sign in to comment.