Support ignore_changes in code-smell tests.

This commit is contained in:
Matt Clay 2019-02-05 14:56:04 -08:00
parent b8a7e35b22
commit 06d83bae05
3 changed files with 32 additions and 15 deletions

View file

@ -255,6 +255,7 @@ class SanityCodeSmellTest(SanityTest):
files = self.config.get('files')
always = self.config.get('always')
text = self.config.get('text')
ignore_changes = self.config.get('ignore_changes')
if output == 'path-line-column-message':
pattern = '^(?P<path>[^:]*):(?P<line>[0-9]+):(?P<column>[0-9]+): (?P<message>.*)$'
@ -263,7 +264,11 @@ class SanityCodeSmellTest(SanityTest):
else:
pattern = ApplicationError('Unsupported output type: %s' % output)
paths = sorted(i.path for i in targets.include)
if ignore_changes:
paths = sorted(i.path for i in targets.targets)
always = False
else:
paths = sorted(i.path for i in targets.include)
if always:
paths = []