aboutsummaryrefslogtreecommitdiffstats
path: root/anteater/src/patch_scan.py
diff options
context:
space:
mode:
authorlhinds <lhinds@redhat.com>2017-09-14 15:39:48 +0100
committerlhinds <lhinds@redhat.com>2017-09-14 15:43:38 +0100
commit5441bf6d822ed743b756af148a9ea74024c795a0 (patch)
treee4f4549523101cb03621552c5b9884f44b88058b /anteater/src/patch_scan.py
parentb3c29549dd5d1048604f45222981d343d0dde09f (diff)
Introduce ignore list for content scans
Anteater was reporting fails on files which are documents and so harmless (for example an rst file) This patch introduces a file_ignore list in master_list.yaml Change-Id: I87c73c80a36114a7df9e1da47d89ca14e3bf668a Signed-off-by: lhinds <lhinds@redhat.com>
Diffstat (limited to 'anteater/src/patch_scan.py')
-rw-r--r--anteater/src/patch_scan.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/anteater/src/patch_scan.py b/anteater/src/patch_scan.py
index 083639f..3b71f0a 100644
--- a/anteater/src/patch_scan.py
+++ b/anteater/src/patch_scan.py
@@ -49,6 +49,9 @@ def prepare_patchset(project, patchset):
# Get file content black list and project waivers
master_list, project_list_re = lists.file_content_list(project)
+ # Get File Ignore Lists
+ file_ignore = lists.file_ignore()
+
# Get Licence Lists
licence_ext = lists.licence_extensions()
licence_ignore = lists.licence_ignore()
@@ -67,7 +70,7 @@ def prepare_patchset(project, patchset):
scan_patch(project, patch_file, binary_list,
file_audit_list, file_audit_project_list,
master_list, project_list_re, licence_ext,
- licence_ignore)
+ file_ignore, licence_ignore)
# Process each file in patch set using waivers generated above
# Process final result
@@ -76,7 +79,7 @@ def prepare_patchset(project, patchset):
def scan_patch(project, patch_file, binary_list, file_audit_list,
file_audit_project_list, master_list,
- project_list_re, licence_ext, licence_ignore):
+ project_list_re, licence_ext, file_ignore, licence_ignore):
""" Scan actions for each commited file in patch set """
global failure
if is_binary(patch_file):
@@ -122,7 +125,7 @@ def scan_patch(project, patch_file, binary_list, file_audit_list,
except IOError:
file_exists = False
- if file_exists:
+ if file_exists and not patch_file.endswith(tuple(file_ignore)):
for line in lines:
for key, value in master_list.iteritems():
regex = value['regex']