render: verbose: don't display locations for file scope matches

This commit is contained in:
William Ballenthin
2020-06-28 01:28:13 -06:00
parent 70c590dfc6
commit 20dffcdd5b

View File

@@ -36,8 +36,9 @@ def render_verbose(doc):
v = v[0]
rows.append((key, v))
locations = doc[rule['meta']['name']]['matches'].keys()
rows.append(('matches', '\n'.join(map(hex, locations))))
if rule['meta']['scope'] != capa.rules.FILE_SCOPE:
locations = doc[rule['meta']['name']]['matches'].keys()
rows.append(('matches', '\n'.join(map(hex, locations))))
ostream.writeln(tabulate.tabulate(rows, tablefmt='plain'))
ostream.write('\n')