dynamic: fix some tests

This commit is contained in:
Willi Ballenthin
2023-10-17 11:41:40 +00:00
parent bf233c1c7a
commit 44d05f9498
6 changed files with 15 additions and 17 deletions

View File

@@ -216,8 +216,8 @@ class InvalidScopes(Lint):
recommendation = "At least one scope (static or dynamic) must be specified"
def check_rule(self, ctx: Context, rule: Rule):
return (rule.meta.get("scope").get("static") in ("unspecified", "unsupported")) and (
rule.meta.get("scope").get("dynamic") in ("unspecified", "unsupported")
return (rule.meta.get("scopes").get("static") in ("unspecified", "unsupported")) and (
rule.meta.get("scopes").get("dynamic") in ("unspecified", "unsupported")
)
@@ -979,10 +979,6 @@ def main(argv=None):
default_samples_path = str(Path(__file__).resolve().parent.parent / "tests" / "data")
# TODO(yelhamer): remove once support for the legacy scope field has been added
# https://github.com/mandiant/capa/pull/1580
return 0
parser = argparse.ArgumentParser(description="Lint capa rules.")
capa.main.install_common_args(parser, wanted={"tag"})
parser.add_argument("rules", type=str, action="append", help="Path to rules")