mirror of
https://github.com/vee1e/capa.git
synced 2026-09-01 18:57:15 +00:00
fix linting issues
This commit is contained in:
parent
12c9154f55
commit
4ee38cbe29
4 changed files with 7 additions and 7 deletions
|
|
@ -204,8 +204,9 @@ SUPPORTED_FEATURES: Dict[str, Set] = {
|
|||
capa.features.common.Namespace,
|
||||
},
|
||||
DEV_SCOPE: {
|
||||
# TODO: this is a temporary scope. remove it after support
|
||||
# TODO(yelhamer): this is a temporary scope. remove it after support
|
||||
# for the legacy scope keyword has been added (to rendering).
|
||||
# https://github.com/mandiant/capa/pull/1580
|
||||
capa.features.insn.API,
|
||||
},
|
||||
}
|
||||
|
|
@ -777,7 +778,6 @@ class Rule:
|
|||
{
|
||||
"name": name,
|
||||
"scopes": asdict(Scopes(subscope.scope, DEV_SCOPE)),
|
||||
""
|
||||
# these derived rules are never meant to be inspected separately,
|
||||
# they are dependencies for the parent rule,
|
||||
# so mark it as such.
|
||||
|
|
@ -864,6 +864,7 @@ class Rule:
|
|||
# we should go back and update this accordingly to either:
|
||||
# - generate one englobing statement.
|
||||
# - generate two respective statements and store them approriately
|
||||
# https://github.com/mandiant/capa/pull/1580
|
||||
statement = build_statements(statements[0], scopes.static)
|
||||
_ = build_statements(statements[0], scopes.dynamic)
|
||||
return cls(name, scopes, statement, meta, definition)
|
||||
|
|
@ -1047,7 +1048,7 @@ def get_rules_with_scope(rules, scope) -> List[Rule]:
|
|||
from the given collection of rules, select those with the given scope.
|
||||
`scope` is one of the capa.rules.*_SCOPE constants.
|
||||
"""
|
||||
return list(rule for rule in rules if scope in rule.scopes)
|
||||
return [rule for rule in rules if scope in rule.scopes]
|
||||
|
||||
|
||||
def get_rules_and_dependencies(rules: List[Rule], rule_name: str) -> Iterator[Rule]:
|
||||
|
|
|
|||
|
|
@ -928,8 +928,8 @@ def main(argv=None):
|
|||
if argv is None:
|
||||
argv = sys.argv[1:]
|
||||
|
||||
# TODO(yelhamer): remove once support for the legacy scope
|
||||
# field has been added
|
||||
# TODO(yelhamer): remove once support for the legacy scope field has been added
|
||||
# https://github.com/mandiant/capa/pull/1580
|
||||
return 0
|
||||
|
||||
samples_path = os.path.join(os.path.dirname(__file__), "..", "tests", "data")
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 3a0081ac6bcf2259d27754c1320478e75a5daeb0
|
||||
Subproject commit f4e21c6037e40607f14d521af370f4eedc2c5eb9
|
||||
|
|
@ -127,7 +127,6 @@ def test_rule_descriptions():
|
|||
|
||||
def rec(statement):
|
||||
if isinstance(statement, capa.engine.Statement):
|
||||
print(statement.description)
|
||||
assert statement.description == statement.name.lower() + " description"
|
||||
for child in statement.get_children():
|
||||
rec(child)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue