lint: ${POPCORN_DIST}
@@echo "Checking Popcorn against JSLint..."
- @@${RHINO} build/jslint-check.js
+ @@${RHINO} build/jslint-check.js popcorn.js ${PLUGINS_SRC}
clean:
@@echo "Removing Distribution directory:" ${DIST_DIR}
@@${MINJAR} --js ${PLUGINS_DIST} --warning_level QUIET --js_output_file ${PLUGINS_MIN}.tmp
@@cat ${PLUGINS_MIN}.tmp >> ${PLUGINS_MIN}
@@rm -f ${PLUGINS_MIN}.tmp
-
-
-
load("build/jslint.js");
-var src = readFile("popcorn.js");
-
-JSLINT(src, { evil: true, forin: true, maxerr: 100 });
-
// All of the following are known issues that we think are 'ok'
// (in contradiction with JSLint) more information here:
// http://docs.jquery.com/JQuery_Core_Style_Guidelines
"'e' is already defined.": true
};
-var e = JSLINT.errors, found = 0, w;
+function check(src)
+{
+ var e = JSLINT.errors, found = 0, w;
+
+ JSLINT(src, { evil: true, forin: true, maxerr: 100 });
-for ( var i = 0; i < e.length; i++ ) {
- w = e[i];
+ for ( var i = 0; e && i < e.length; i++ ) {
+ w = e[i];
- if ( !ok[ w.reason ] ) {
- found++;
- print( "\n" + w.evidence + "\n" );
- print( " Problem at line " + w.line + " character " + w.character + ": " + w.reason );
+ if ( w && !ok[ w.reason ] ) {
+ found++;
+ print( "\n" + w.evidence + "\n" );
+ print( " Problem at line " + w.line + " character " + w.character + ": " + w.reason );
+ }
+ }
+
+ if ( found > 0 ) {
+ print( "\n" + found + " Error(s) found." );
+ } else {
+ print( "JSLint check passed." );
}
}
-if ( found > 0 ) {
- print( "\n" + found + " Error(s) found." );
-
-} else {
- print( "JSLint check passed." );
+for each (var f in arguments)
+{
+ print( "Linting "+ f );
+ check(readFile(f));
}