Add test for invalid ignore entries.

This commit is contained in:
Matt Clay 2019-06-24 10:55:16 -07:00
parent 547a29805e
commit 535e646a66

View file

@ -168,6 +168,21 @@ class ValidateModulesTest(SanitySingleVersion):
confidence=calculate_best_confidence(((VALIDATE_SKIP_PATH, line), (path, 0)), args.metadata) if args.metadata.changes else None, confidence=calculate_best_confidence(((VALIDATE_SKIP_PATH, line), (path, 0)), args.metadata) if args.metadata.changes else None,
)) ))
for path in sorted(ignore.keys()):
if os.path.exists(path):
continue
for line in sorted(ignore[path].values()):
# Keep files out of the list which no longer exist in the repo.
errors.append(SanityMessage(
code='A101',
message='Remove "%s" since it does not exist' % path,
path=VALIDATE_IGNORE_PATH,
line=line,
column=1,
confidence=calculate_best_confidence(((VALIDATE_IGNORE_PATH, line), (path, 0)), args.metadata) if args.metadata.changes else None,
))
for path in paths: for path in paths:
if path not in ignore: if path not in ignore:
continue continue