summaryrefslogtreecommitdiff
path: root/ACE/bin/PythonACE/fuzz/newline.py
diff options
context:
space:
mode:
Diffstat (limited to 'ACE/bin/PythonACE/fuzz/newline.py')
-rw-r--r--ACE/bin/PythonACE/fuzz/newline.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/ACE/bin/PythonACE/fuzz/newline.py b/ACE/bin/PythonACE/fuzz/newline.py
new file mode 100644
index 00000000000..39847e05c65
--- /dev/null
+++ b/ACE/bin/PythonACE/fuzz/newline.py
@@ -0,0 +1,17 @@
+""" Checks that the file has a newline at the end. """
+
+type_list = ["cpp", "h", "inl", "html", "idl", "pl"]
+
+import re
+from sys import stderr
+
+regex = re.compile ("\n\Z")
+
+def handler (file_name, file_content):
+ if regex.search (file_content) == None:
+ stderr.write (file_name + ":0: error: " + file_name + " lacks a newline at the end of the file.\n")
+ return 1
+ else:
+ return 0
+
+