Skip to content

Commit c81a479

Browse files
CaseyCartertkoeppe
authored andcommitted
[travis] Add test for extraneous blank lines at the end of files
1 parent 2da91da commit c81a479

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ env:
77
- BUILD_TYPE=make # build using Makefile
88
- BUILD_TYPE=complete # build manually and regenerate figures, grammar, and cross-references
99
- BUILD_TYPE=check-whitespace # check for whitespace at the ends of lines
10+
- BUILD_TYPE=check-newlines # check for blank lines at the ends of files
1011

1112
script:
1213
# Build std.pdf
@@ -38,6 +39,10 @@ script:
3839
- if [ "$BUILD_TYPE" = "check-whitespace" ]; then
3940
! grep '\s$' source/*.tex;
4041
fi
42+
# Fail if there are blank lines at the ends of any files
43+
- if [ "$BUILD_TYPE" = "check-newlines" ]; then
44+
for f in source/*.tex; do [ $(tail -c 2 $f | wc -l) -eq 1 ] || exit 1; done;
45+
fi
4146
# Check to see if generated files are out-dated
4247
- pushd source
4348
- for FIGURE in *.dot; do

0 commit comments

Comments
 (0)