Index: tools/presubmit.py |
diff --git a/tools/presubmit.py b/tools/presubmit.py |
index 9f4834c2190981b57e19df834fa2d3b4900a380b..56eac8ecea47aa9c4501a21ee7506df55911af71 100755 |
--- a/tools/presubmit.py |
+++ b/tools/presubmit.py |
@@ -362,6 +362,9 @@ class SourceProcessor(SourceFileProcessor): |
else: |
print "%s has trailing whitespaces in line %s." % (name, linenumbers) |
result = False |
+ if not contents.endswith('\n') or contents.endswith('\n\n'): |
+ print "%s does not end with a single new line." % name |
+ result = False |
# Check two empty lines between declarations. |
if name.endswith(".cc"): |
line = 0 |