summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2017-12-18 02:16:35 +0000
committerGerrit Code Review <review@openstack.org>2017-12-18 02:16:35 +0000
commitbe8d9b6520c765b786bcb3939ba795637b7a4f98 (patch)
treecab3e20ff1addd1ad992037aad5bc857f5c22532
parentdcbb7e7ebb06407a6400467721c4a99eaee67ce4 (diff)
parent55537519e51de064e78795d260e1fed1af1a352a (diff)
Merge "Check source-repository-* files for trailing newline"HEADmaster
-rwxr-xr-xbin/dib-lint9
1 files changed, 9 insertions, 0 deletions
diff --git a/bin/dib-lint b/bin/dib-lint
index b76e78a..e1e3c82 100755
--- a/bin/dib-lint
+++ b/bin/dib-lint
@@ -86,6 +86,15 @@ for i in $(find $ELEMENTS_DIR -type f \
86 86
87 exclusions=("$(parse_exclusions $i)") 87 exclusions=("$(parse_exclusions $i)")
88 88
89 # source-repository does a read < $file and can miss the last line
90 # (or only line, if there's only one) when not newline terminated.
91 if [[ $(basename "${i}") =~ "source-repository-" ]]; then
92 nl=$(tail -c 1 ${i})
93 if [[ "${nl}" != "" ]]; then
94 error "$i does not end with a newline"
95 fi
96 fi
97
89 # Check that files starting with a shebang are +x 98 # Check that files starting with a shebang are +x
90 firstline=$(head -n 1 "$i") 99 firstline=$(head -n 1 "$i")
91 if [ "${firstline:0:2}" = "#!" ]; then 100 if [ "${firstline:0:2}" = "#!" ]; then