Permalink
Browse files

Add test to ensure semicolons or tabs don't happen again

  • Loading branch information...
1 parent c15aa80 commit 6d232e0a0b1cdf586b6e931cfb0e209f3663426f @mislav mislav committed Jul 13, 2016
Showing with 19 additions and 0 deletions.
  1. +17 −0 script/lint
  2. +2 −0 script/test
View
@@ -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 }
View
@@ -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=$!

0 comments on commit 6d232e0

Please sign in to comment.