Permalink
Browse files

Implemented LintRunner

  • Loading branch information...
1 parent 8d46205 commit a6a60a05cdca7a76970d0c8a6fc9620abe78dfcb @arthurakay arthurakay committed Jan 16, 2013
Showing with 56 additions and 1 deletion.
  1. +2 −1 .gitignore
  2. +39 −0 syntax/Lint-Runner.js
  3. +15 −0 syntax/run_lint.sh
View
@@ -1,3 +1,4 @@
.DS_Store
.idea/
-unit-tests/*-errors.txt
+unit-tests/*-errors.txt
+syntax/error_log.txt
View
@@ -0,0 +1,39 @@
+var LintRoller = require('../node_modules/lintroller');
+
+var config = {
+ verbose : false,
+ stopOnFirstError : false,
+
+ //recursively include JS files in these folders
+ filepaths : [
+ '../'
+ ],
+
+ //but ignore anything in these folders
+ exclusions : [
+ '../node_modules/',
+ '../resources/',
+ '../docs/'
+ ],
+
+ linters : [
+ {
+ type : 'jsLint'
+ },
+ {
+ type : 'jsHint'
+ },
+ {
+ type : 'esprima'
+ }
+ ]
+};
+
+try {
+ LintRoller.init(config);
+}
+catch (e) {
+ console.log('\nAn error has been caught:\n\n');
+ console.log(e);
+ process.exit(1);
+}
View
@@ -0,0 +1,15 @@
+clear
+
+### Check for errors; abandon the process if error exist
+function checkError {
+ if [[ $1 != 0 ]] ; then
+ exit 99
+ fi
+}
+
+echo "*** LintRoller on /app/... ***"
+node Lint-Runner.js
+checkError $?
+
+### Exit successfully
+exit 0

0 comments on commit a6a60a0

Please sign in to comment.