[Bug] Fix AttributeError in RuleCollection dupe check (#1747)
(cherry picked from commit 2828633919)
This commit is contained in:
committed by
github-actions[bot]
parent
f661eca2eb
commit
bd826ceeb3
@@ -525,7 +525,7 @@ class TOMLRuleContents(BaseRuleContents, MarshmallowDataclassMixin):
|
||||
class TOMLRule:
|
||||
contents: TOMLRuleContents = field(hash=True)
|
||||
path: Optional[Path] = None
|
||||
gh_pr: Any = field(hash=False, compare=False, default=None, repr=None)
|
||||
gh_pr: Any = field(hash=False, compare=False, default=None, repr=False)
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
|
||||
@@ -203,7 +203,7 @@ class RuleCollection(BaseCollection):
|
||||
|
||||
assert not self.frozen, f"Unable to add rule {rule.name} {rule.id} to a frozen collection"
|
||||
assert rule.id not in id_map, \
|
||||
f"Rule ID {rule.id} for {rule.name} collides with rule {id_map.get(rule.id).get('name')}"
|
||||
f"Rule ID {rule.id} for {rule.name} collides with rule {id_map.get(rule.id).name}"
|
||||
|
||||
if rule.path is not None:
|
||||
rule_path = rule.path.resolve()
|
||||
|
||||
Reference in New Issue
Block a user