mirror of
https://github.com/mandiant/capa.git
synced 2025-12-19 10:42:31 -08:00
lint: cleanup handling of nursery rules further
This commit is contained in:
@@ -531,11 +531,11 @@ def lint_rule(ctx, rule):
|
||||
if is_nursery_rule(rule):
|
||||
has_examples = not any(map(lambda v: v.level == Lint.FAIL and v.name == "missing examples", violations))
|
||||
lints_failed = len(
|
||||
tuple(filter(lambda v: v.level == Lint.FAIL and not v.name == "missing examples", violations))
|
||||
tuple(filter(lambda v: v.level == Lint.FAIL and not (v.name == "missing examples" or v.name == "referenced example doesn't exist"), violations))
|
||||
)
|
||||
lints_warned = len(tuple(filter(lambda v: v.level == Lint.WARN, violations)))
|
||||
lints_warned = len(tuple(filter(lambda v: v.level == Lint.WARN or (v.level == Lint.FAIL and v.name == "referenced example doesn't exist"), violations)))
|
||||
|
||||
if (not lints_failed) and has_examples:
|
||||
if (not lints_failed) and (not lints_warned) and has_examples:
|
||||
print("")
|
||||
print("%s%s" % (" (nursery) ", rule.name))
|
||||
print("%s %s: %s: %s" % (" ", Lint.WARN, "no lint failures", "Graduate the rule"))
|
||||
|
||||
Reference in New Issue
Block a user