Skip to content

Commit

Permalink
vverbose: render relevant scope at top of match tree
Browse files Browse the repository at this point in the history
closes #1710
  • Loading branch information
williballenthin authored Aug 11, 2023
1 parent 3057b5f commit fd1cd05
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions capa/render/vverbose.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,13 @@ def render_rules(ostream, doc: rd.ResultDocument):
render_match(ostream, first_match, indent=0)
else:
for location, match in sorted(doc.rules[rule.meta.name].matches):
ostream.write(f"static scope: {rule.meta.scopes.static}")
ostream.write(f"dynamic scope: {rule.meta.scopes.dynamic}")
if doc.meta.flavor == rd.Flavor.STATIC:
ostream.write(f"{rule.meta.scopes.static}")
elif doc.meta.flavor == rd.Flavor.DYNAMIC:
ostream.write(f"{rule.meta.scopes.dynamic}")
else:
capa.helpers.assert_never(doc.meta.flavor)

ostream.write(" @ ")
ostream.write(capa.render.verbose.format_address(location))

Expand Down

0 comments on commit fd1cd05

Please sign in to comment.