Skip to content

Commit

Permalink
Fix/tests in master (#2592)
Browse files Browse the repository at this point in the history
  • Loading branch information
williballenthin authored Feb 4, 2025
1 parent 5467fac commit 40203a0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions capa/render/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ def capability_rules(doc: rd.ResultDocument) -> Iterator[rd.RuleMatches]:
for _, _, rule in sort_rules(doc.rules):
if rule.meta.lib:
continue
if (rule.meta.namespace or "").startswith("internal/"):
continue
if rule.meta.is_subscope_rule:
continue
if rule.meta.maec.analysis_conclusion:
Expand Down
6 changes: 3 additions & 3 deletions capa/rules/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2227,8 +2227,8 @@ def get_rules(
on_load_rule(path, i, total_rule_count)

try:
rule = capa.rules.Rule.from_yaml(content.decode("utf-8"))
except capa.rules.InvalidRule:
rule = Rule.from_yaml(content.decode("utf-8"))
except InvalidRule:
raise
else:
rule.meta["capa/path"] = path.as_posix()
Expand All @@ -2237,7 +2237,7 @@ def get_rules(
rules.append(rule)
logger.debug("loaded rule: '%s' with scope: %s", rule.name, rule.scopes)

ruleset = capa.rules.RuleSet(rules)
ruleset = RuleSet(rules)

capa.rules.cache.cache_ruleset(cache_dir, ruleset)

Expand Down

0 comments on commit 40203a0

Please sign in to comment.