Skip to content

Commit

Permalink
Fix python.lang.correctness.baseclass-attribute-override (#3434)
Browse files Browse the repository at this point in the history
The rule depended on Semgrep unifying two identifiers, corresponding to
methods in two different classes, that were not the same but just had
the same "string" name.
  • Loading branch information
IagoAbal authored Jul 18, 2024
1 parent b570a5a commit cd6cd52
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions python/lang/correctness/baseclass-attribute-override.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,19 @@ rules:
- pattern-inside: |
class $A(...):
...
def $F(...):
def $F1(...):
...
...
...
- pattern-inside: |
class $B(...):
...
def $F(...):
def $F2(...):
...
...
...
- metavariable-comparison:
comparison: str($F1) == str($F2)
- pattern: |
class $C(..., $A, ..., $B, ...):
...
Expand Down

0 comments on commit cd6cd52

Please sign in to comment.