Commit 12bbf687 authored by Ben Avison's avatar Ben Avison
Browse files

Test for files ending with blank lines

This test is implemented using sed. The list of files is echoed to the output,
and the test is a (warning-class) failure if the list is non-empty. Files can
be explicitly omitted from this test by adding them to `WHITESPACE_WHITELIST`
in `.gitlab-ci.yml`.
parent dc064d26
Pipeline #3949 passed with stage
in 4 seconds
......@@ -490,6 +490,24 @@ BEGIN {
print " allow_failure: true" >> out
print "" >> out
print "endblanks:" >> out
print " stage: static_analysis" >> out
print " tags: [ cross ]" >> out
print " script:" >> out
print " - >" >> out
print " exceptions=();" >> out
print " while read -d \" \" part; do" >> out
print " if [ \"$part\" != \"\" ]; then" >> out
print " exceptions=(\"${exceptions[@]}\" -path \"$part\" -prune -o);" >> out
print " fi;" >> out
print " done <<< \"$WHITESPACE_WHITELIST \";" >> out
print " test $(find . \"${exceptions[@]}\"" >> out
print " -path \"./.git\" -prune -o" >> out
print " -type f \\( -exec sed -n -e '${/^$/q1}' {} \\; -o -print \\)" >> out
print " | tee /dev/stderr | wc -l) = 0" >> out
print " allow_failure: true" >> out
print "" >> out
print "head_whitesp:" >> out
print " stage: static_analysis" >> out
print " tags: [ cross ]" >> out
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment