Browse files

Lint: Fix warnings introduced in v2 branch.

map.js: line 264, col 1, Mixed spaces and tabs.
map.js: line 265, col 1, Mixed spaces and tabs.
testswarm-browserstack.js: line 145, col 23, Missing space after ':'.
testswarm-browserstack.js: line 157, col 55, Missing space after 'action=spawnworker error='.
testswarm-browserstack.js: line 157, col 69, Missing space after ' browser= '.
testswarm-browserstack.js: line 157, col 70, Missing space after '+'.
testswarm-browserstack.js: line 157, col 93, Unexpected space after ')'.
testswarm-browserstack.js: line 163, col 23, Missing space after ':'.
testswarm-browserstack.js: line 189, col 23, Missing space after ':'.
testswarm-browserstack.js: line 202, col 23, Missing space after ':'.
testswarm-browserstack.js: line 279, col 11, Missing space after 'if'.
testswarm-browserstack.js: line 279, col 27, Missing space after ')'.
testswarm-browserstack.js: line 292, col 20, Missing space after ':'.
testswarm-browserstack.js: line 419, col 53, Unexpected space after '('.
testswarm-browserstack.js: line 443, col 19, Missing semicolon.
testswarm-browserstack.js: line 155, col 67, 'worker' is defined but never used.
util.js: line 95, col 19, Missing space after ')'.
util.js: line 97, col 7, Missing space after 'if'.
util.js: line 97, col 61, Missing space after ')'.
util.js: line 100, col 10, Missing semicolon.
util.js: line 103, col 7, Missing space after 'if'.
util.js: line 103, col 21, Missing space after ')'.
util.js: line 104, col 36, Missing semicolon.
util.js: line 107, col 8, Missing space after 'for'.
util.js: line 107, col 9, Bad for in variable 'i'.
util.js: line 107, col 19, Missing space after ')'.
util.js: line 108, col 13, Too many var statements.
util.js: line 109, col 11, Missing space after 'if'.
util.js: line 109, col 32, Missing space after ')'.
util.js: line 112, col 10, Missing space after 'l'.
util.js: line 112, col 14, Missing space after 'i'.
util.js: line 112, col 15, Missing space after '+'.
util.js: line 112, col 18, Missing space after '='.
util.js: line 112, col 29, Missing space after '+'.
util.js: line 115, col 7, Missing space after 'if'.
util.js: line 115, col 19, Missing space after ')'.
util.js: line 116, col 21, Expected an assignment or function call and instead saw an expression.
util.js: line 108, col 28, 'i' is not defined.
util.js: line 112, col 14, 'i' is not defined.
util.js: line 2, col 11, 'colors' is defined but never used.

40 errors
  • Loading branch information...
1 parent c03a143 commit c55515d890d34f862bd6afecce4cb47b5697fd66 @Krinkle Krinkle committed Nov 14, 2012
Showing with 44 additions and 42 deletions.
  1. +1 −1 .jshintignore
  2. +0 −2 .jshintrc
  3. +2 −2 src/map.js
  4. +10 −9 src/testswarm-browserstack.js
  5. +31 −28 src/util.js
View
2 .jshintignore
@@ -1 +1 @@
-node_modules
+node_modules/
View
2 .jshintrc
@@ -3,14 +3,12 @@
"camelcase": true,
"curly": true,
"eqeqeq": true,
- "forin": false,
"immed": true,
"latedef": true,
"newcap": true,
"noarg": true,
"noempty": true,
"nonew": true,
- "plusplus": false,
"quotmark": "single",
"regexp": true,
"undef": true,
View
4 src/map.js
@@ -261,8 +261,8 @@ var map = {
os: 'ios'
}
- // TODO: Most of the following ua's are supported by BrowserStack.
- // However we need support for it via the API
+ // TODO: Most of the following ua's are supported by BrowserStack.
+ // However we need support for it via the API
// 'Fennec|4': {},
// 'Opera Mobile': {},
View
19 src/testswarm-browserstack.js
@@ -142,7 +142,7 @@ self = {
action: 'spawn',
browser: browser,
dryrun: true,
- color:'cyan'
+ color: 'cyan'
});
return;
}
@@ -154,13 +154,14 @@ self = {
client.createWorker(browserSettings, function (err, worker) {
if (err) {
- this.error('action=spawnworker error='+ ' browser= '+JSON.stringify(browser) , browser, err);
+ this.error('action=spawnworker error=' + ' browser= ' + JSON.stringify(browser), browser, err);
return;
}
util.log({
action: 'spawn',
browser: browser,
- color:'green'
+ worker: worker,
+ color: 'green'
});
});
},
@@ -186,7 +187,7 @@ self = {
action: 'terminate',
worker: worker,
dryrun: true,
- color:'cyan'
+ color: 'cyan'
});
return;
}
@@ -199,7 +200,7 @@ self = {
util.log({
action: 'terminate',
worker: worker,
- color:'yello'
+ color: 'yello'
});
});
},
@@ -276,7 +277,7 @@ self = {
}
});
- if(config.verbose){
+ if (config.verbose) {
util.log('Summary:', (function () {
var ua, summary = {};
for (ua in workersByUa) {
@@ -289,7 +290,7 @@ self = {
}
util.log({
- action:'liveWorkers',
+ action: 'liveWorkers',
liveWorkers: percWorkers
});
if (config.verbose) {
@@ -416,7 +417,7 @@ self = {
// Note: Don't filter for where onlineClients is 0 (though task 2 already covers those,
// and `anything / 0 = NaN`, it only does one, we have eqLimit still).
// Fixed by doing +1 on onlineClients (see also clarkbox/testswarm-browserstack#31).
- priority = stats.pendingRuns / ( stats.onlineClients + 1);
+ priority = stats.pendingRuns / (stats.onlineClients + 1);
}
if (priority > neediest.priority) {
neediest = {
@@ -440,7 +441,7 @@ self = {
util.log({
action: 'notice',
message: 'Neediness exhausted, done!'
- })
+ });
break;
} else {
if (config.verbose) {
View
59 src/util.js
@@ -1,5 +1,6 @@
-var _ = require('underscore'),
- colors = require('colors');
+var _ = require('underscore');
+require('colors');
+
/**
* Like typeof === 'object' but more accurate.
* (null is not an object, arrays and functions are objects).
@@ -92,37 +93,39 @@ function generateReverseMap(map) {
return rev;
}
-function log(data){
- var l = (new Date()) + ' : ';
- if(typeof data === 'string' || typeof data === 'number'){
- data = {
- message: data
- }
- }
-
- if(!data.action){
- data.action = 'unspecified'
- }
-
- for(i in data){
- var literal = data[i];
- if(_.isObject(literal)){
- literal = JSON.stringify(literal);
- }
- l+= i+'='+ literal +' ';
- }
-
- if(data.color){
- l[data.color];
- }
-
- console.log(l);
+function log(data) {
+ var key, msg, literal;
+
+ msg = new Date() + ' : ';
+ if (typeof data === 'string' || typeof data === 'number') {
+ data = {
+ message: data
+ };
+ }
+
+ if (!data.action) {
+ data.action = 'unspecified';
+ }
+
+ for (key in data) {
+ literal = data[key];
+ if (_.isObject(literal)) {
+ literal = JSON.stringify(literal);
+ }
+ msg += key + '=' + literal + ' ';
+ }
+
+ if (data.color) {
+ msg = msg[data.color];
+ }
+
+ console.log(msg);
}
module.exports = {
extendObject: extendObject,
copy: copy,
getHash: getHash,
generateReverseMap: generateReverseMap,
- log: log
+ log: log
};

0 comments on commit c55515d

Please sign in to comment.