diff options
-rwxr-xr-x | presubmit.sh | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/presubmit.sh b/presubmit.sh index 58f66282..55bfd23b 100755 --- a/presubmit.sh +++ b/presubmit.sh @@ -78,7 +78,13 @@ readonlyvars_tests() { local -r str_local="local" local -r str_ronly="readonly" - ! grep -Hn --color -E "\<(${str_local} ${str_ronly}|${str_ronly} ${str_local})\>" "${shell_files[@]}" + ! grep -Hn --color -E "\<(${str_local} ${str_ronly}|${str_ronly} ${str_local})\>" \ + "${shell_files[@]}" +} + +# Check for trailing whitespaces +trailing_whitespaces_tests() { + ! grep -n '[[:blank:]]$' "${shell_files[@]}" } main() { @@ -87,6 +93,8 @@ main() { if_error "shellcheck presubmit test FAILED." readonlyvars_tests if_error "Scope/read-only variables presubmit test FAILED." + trailing_whitespaces_tests + if_error "Trailing Whitespaces test FAILED" log S "Presubmit tests PASSED." exit 0 } |