lint: cleanup handling of nursery rules further

This commit is contained in:
William Ballenthin
2021-05-19 16:13:45 -06:00
parent 3eef034a94
commit 0a1adb99e0

View File

@@ -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"))