aboutsummaryrefslogtreecommitdiffstats
path: root/anteater
diff options
context:
space:
mode:
Diffstat (limited to 'anteater')
-rw-r--r--anteater/src/project_scan.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/anteater/src/project_scan.py b/anteater/src/project_scan.py
index 9b143e9..09a4791 100644
--- a/anteater/src/project_scan.py
+++ b/anteater/src/project_scan.py
@@ -57,6 +57,7 @@ def prepare_project(project, project_dir):
# Perform licence header checks
licence_check(licence_ext, licence_ignore, project, project_dir)
+ licence_root_check(project_dir, project)
def scan_file(project_dir, project, binary_list, binary_project_list,
@@ -124,6 +125,20 @@ def scan_file(project_dir, project, binary_list, binary_project_list,
format(full_path))
+def licence_root_check(project_dir, project):
+ if os.path.isfile(project_dir + '/LICENSE'):
+ logger.info('LICENSE file present in: {0}'.
+ format(project_dir))
+ else:
+ logger.error('LICENSE file missing in: {0}'.
+ format(project_dir))
+ with open(reports_dir + "licence-" + project + ".log",
+ "a") \
+ as gate_report:
+ gate_report.write('LICENSE file missing in: {0}\n'.
+ format(project_dir))
+
+
def licence_check(licence_ext, licence_ignore, project, project_dir):
""" Peform basic checks for the presence of licence strings """
for root, dirs, files in os.walk(project_dir):