diff options
author | Artem Serov <artem.serov@linaro.org> | 2021-08-20 13:49:33 +0000 |
---|---|---|
committer | Linaro Android Code Review <android-review@review.linaro.org> | 2021-08-20 13:49:33 +0000 |
commit | 22bbceb875dc61a9dec480c458ad294afc9acacb (patch) | |
tree | f28dc539b49d3c85cdf19382855c39865adab595 | |
parent | 87674f3de84cb783fcaa1f332dbbee500ab88eee (diff) | |
parent | 9e9396d7896ccf4ee28bdb5f125b805a691b7cd9 (diff) | |
download | art-build-scripts-22bbceb875dc61a9dec480c458ad294afc9acacb.tar.gz |
Merge "ART: Make presubmit.sh check for style."
-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 } |