From bd826ceeb3e79da491d1a53919a2bb4d8ed9b56a Mon Sep 17 00:00:00 2001 From: Justin Ibarra Date: Mon, 31 Jan 2022 15:57:46 -0900 Subject: [PATCH] [Bug] Fix AttributeError in RuleCollection dupe check (#1747) (cherry picked from commit 2828633919b62ee6ae9ac55f61b3a7bbaa0b4b39) --- detection_rules/rule.py | 2 +- detection_rules/rule_loader.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/detection_rules/rule.py b/detection_rules/rule.py index 14a92a3f7..525785a67 100644 --- a/detection_rules/rule.py +++ b/detection_rules/rule.py @@ -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): diff --git a/detection_rules/rule_loader.py b/detection_rules/rule_loader.py index a7173e7c2..d164d7aa8 100644 --- a/detection_rules/rule_loader.py +++ b/detection_rules/rule_loader.py @@ -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()