Support comments in ansible-test flat files.

This commit is contained in:
Matt Clay 2018-09-19 23:20:27 -07:00
parent cb4bf04be6
commit 5a3000af19
13 changed files with 135 additions and 96 deletions

View file

@ -17,6 +17,7 @@ from lib.util import (
parse_to_dict,
display,
find_executable,
read_lines_without_comments,
)
from lib.config import (
@ -40,8 +41,8 @@ class RstcheckTest(SanitySingleVersion):
display.warning('Skipping rstcheck on unsupported Python version %s.' % args.python_version)
return SanitySkipped(self.name)
with open('test/sanity/rstcheck/ignore-substitutions.txt', 'r') as ignore_fd:
ignore_substitutions = sorted(set(ignore_fd.read().splitlines()))
ignore_file = 'test/sanity/rstcheck/ignore-substitutions.txt'
ignore_substitutions = sorted(set(read_lines_without_comments(ignore_file, remove_blank_lines=True)))
paths = sorted(i.path for i in targets.include if os.path.splitext(i.path)[1] in ('.rst',))