Permalink
Browse files

final tweaks for jshint inclusion

  • Loading branch information...
1 parent b8d02d5 commit 3043d5c7e6a1a6e32b2b068c3cc4469f607bf4a1 @filmaj committed Apr 20, 2012
Showing with 10 additions and 7 deletions.
  1. +6 −4 Jakefile
  2. +3 −2 README.md
  3. +1 −1 lib/cordova.js
View
@@ -57,7 +57,7 @@ task('clean', ['set-cwd'], function () {
}, true);
desc("compiles the source files for all extensions");
-task('build', ['clean'], function () {
+task('build', ['clean', 'hint'], function () {
var packager = require("./build/packager");
var commitId = "";
childProcess.exec("git log -1",function(err,stdout,stderr) {
@@ -66,7 +66,7 @@ task('build', ['clean'], function () {
commitId = stdoutLines[0];
}
- console.log("commit = " + commitId);
+ console.log("building " + commitId);
packager.generate("blackberry",commitId);
packager.generate("playbook",commitId);
packager.generate("ios",commitId);
@@ -100,10 +100,12 @@ desc('check sources with JSHint');
task('hint', ['fixwhitespace'], function () {
var knownWarnings = ["Redefinition of 'FileReader'", "Redefinition of 'require'", "Read only"];
var filterKnownWarnings = function(el, index, array) {
- var wut = false;
+ var wut = true;
+ // filter out the known warnings listed out above
knownWarnings.forEach(function(e) {
- wut = wut && (el.indexOf(e) > -1);
+ wut = wut && (el.indexOf(e) == -1);
});
+ wut = wut && (!el.match(/\d+ errors/));
return wut;
};
View
@@ -67,8 +67,9 @@ All of the build tasks can be run via the `jake` node module. Install it globall
sudo npm install -g jake
-Every build also runs the scripts through [JSHint](). It is best
-installed globally:
+Every build also runs the scripts through [JSHint](http://jshint.com). It is best
+installed globally, but it is _not_ necessary for building cordova-js
+(you just won't get syntax and style hints when you build):
sudo npm install -g jshint
View
@@ -264,4 +264,4 @@ if (!window.plugins) {
window.plugins = {};
}
-module.exports = cordova;
+module.exports = cordova;

0 comments on commit 3043d5c

Please sign in to comment.