From 5441bf6d822ed743b756af148a9ea74024c795a0 Mon Sep 17 00:00:00 2001 From: lhinds Date: Thu, 14 Sep 2017 15:39:48 +0100 Subject: 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 --- anteater/src/patch_scan.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'anteater/src/patch_scan.py') 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'] -- cgit 1.2.3-korg