Skip to content

Commit

Permalink
Add test to ensure semicolons or tabs don't happen again
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav committed Jul 13, 2016
1 parent c15aa80 commit 6d232e0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
17 changes: 17 additions & 0 deletions script/lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/awk -f

BEGIN { if (length(ARGV) < 2) exit 0 }

/<script/ { script=FILENAME }
/<\/script/ { script="" }

/;\s*$/ && (FILENAME !~ /.html$/ || script == FILENAME) {
printf("%s:%d: no semicolons, please\n", FILENAME, FNR)
warns++
}
/\t/ {
printf("%s:%d: use spaces instead of tabs\n", FILENAME, FNR)
warns++
}

END { if (warns) exit 1 }
2 changes: 2 additions & 0 deletions script/test
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ test_url="http://localhost:${port}/"

export PATH=node_modules/.bin:"$PATH"

git ls-files \*.js \*.html | grep -v ^vendor/ | xargs script/lint

coffee test/server.coffee $port &
pid=$!

Expand Down

0 comments on commit 6d232e0

Please sign in to comment.