diff options
Diffstat (limited to 'ACE/bin/PythonACE/fuzz/max_project_len.py')
-rw-r--r-- | ACE/bin/PythonACE/fuzz/max_project_len.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/ACE/bin/PythonACE/fuzz/max_project_len.py b/ACE/bin/PythonACE/fuzz/max_project_len.py new file mode 100644 index 00000000000..39d3b14c163 --- /dev/null +++ b/ACE/bin/PythonACE/fuzz/max_project_len.py @@ -0,0 +1,26 @@ +""" Checks that project names are not too long """ + +from max_filename import max_filename_length + +type_list = ["mpc"] + +max_proj_len = max_filename_length - 12 # GNUmakefile. + +from sys import stderr +import re + +regex = re.compile ("\s*project\s*\((\w+)\)") + +def handler (file_name, file_content): + match = regex.search (file_content) + if match == None: + return 0 + else: + for group in match.groups (): + stderr.write (file_name + ":0: error: Project named " + group + + " meets or exceeds the maximum project name length of " + + str (max_proj_len) + " characters\n") + + return 1 + + |