From 0ffe7cd5dc5848a192771dbe8ef34eff93d860a1 Mon Sep 17 00:00:00 2001 From: gbrodman Date: Wed, 3 Jul 2019 12:16:11 -0400 Subject: [PATCH] Enforce that source files end in a newline (#153) --- config/presubmits.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config/presubmits.py b/config/presubmits.py index bb3a4f501..a5113cc3e 100644 --- a/config/presubmits.py +++ b/config/presubmits.py @@ -82,6 +82,11 @@ PRESUBMITS = { }, REQUIRED): "File did not include the license header.", + # Files must end in a newline + PresubmitCheck(r".*\n$", ("java", "js", "soy", "sql", "py", "sh", "gradle"), + {"node_modules/"}, REQUIRED): + "Source files must end in a newline.", + # System.(out|err).println should only appear in tools/ PresubmitCheck( r".*\bSystem\.(out|err)\.print", "java", {