Permalink
Browse files

Added makefile for jslint and jshint execution. *.js linted

  • Loading branch information...
1 parent 5770e18 commit e22652c8c8ea54a4331bd7929c19d67324a90c9c @tomterl committed Jun 1, 2012
Showing with 94 additions and 6 deletions.
  1. +72 −0 .jshintrc
  2. +20 −0 Makefile
  3. +2 −6 lib/tbwdjs.js
View
@@ -0,0 +1,72 @@
+{
+ // Enforcing Options /////////////////////////////////////////////////////////
+
+ "bitwise" : true, // Prohibit bitwise operators (&, |, ^, etc.).
+ "curly" : true, // Require {} for every new block or scope.
+ "eqeqeq" : true, // Require triple equals i.e. `===`.
+ "forin" : false, // Tolerate `for in` loops without `hasOwnPrototype`.
+ "immed" : true, // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );`
+ "latedef" : false, // Prohibit variable use before definition.
+ "newcap" : true, // Require capitalization of all constructor functions e.g. `new F()`.
+ "noarg" : true, // Prohibit use of `arguments.caller` and `arguments.callee`.
+ "noempty" : true, // Prohibit use of empty blocks.
+ "nonew" : true, // Prohibit use of constructors for side-effects.
+ "plusplus" : false, // Prohibit use of `++` & `--`.
+ "regexp" : false, // Prohibit `.` and `[^...]` in regular expressions.
+ "undef" : true, // Require all non-global variables be declared before they are used.
+ "strict" : true, // Require `use strict` pragma in every file.
+ "trailing" : true, // Prohibit trailing whitespaces.
+
+ // Relaxing Options //////////////////////////////////////////////////////////
+
+ "asi" : false, // Tolerate Automatic Semicolon Insertion (no semicolons).
+ "boss" : false, // Tolerate assignments inside if, for & while. Usually conditions & loops are for comparison, not assignments.
+ "debug" : false, // Allow debugger statements e.g. browser breakpoints.
+ "eqnull" : false, // Tolerate use of `== null`.
+ "es5" : true, // Allow ECMAScript 5 syntax.
+ "esnext" : false, // Allow ES.next specific features such as const and let.
+ "evil" : false, // Tolerate use of `eval`.
+ "expr" : false, // Tolerate `ExpressionStatement` as Programs.
+ "funcscope" : false, // Tolerate declaring variables inside of control structures while accessing them later
+ "globalstrict" : true, // Allow global "use strict" (also enables 'strict').
+ "iterator" : false, // Allow usage of __iterator__ property.
+ "lastsemic" : false, // Tolerate semicolon omitted for the last statement.
+ "laxbreak" : false, // Tolerate unsafe line breaks e.g. `return [\n] x` without semicolons.
+ "laxcomma" : false, // Suppresses warnings about comma-first coding style.
+ "loopfunc" : false, // Allow functions to be defined within loops.
+ "multistr" : false, // Tolerate multi-line strings.
+ "onecase" : false, // Tolerate switches with only one case.
+ "proto" : false, // Allow usage of __proto__ property.
+ "regexdash" : false, // Tolerate unescaped last dash i.e. `[-...]`.
+ "scripturl" : false, // Tolerate script-targeted URLs.
+ "smarttabs" : false, // Allow mixed tabs and spaces when the latter are used for alignment only.
+ "shadow" : false, // Allows re-define variables later in code e.g. `var x=1; x=2;`.
+ "sub" : false, // Tolerate all forms of subscript notation besides dot notation e.g. `dict['key']` instead of `dict.key`.
+ "supernew" : true, // Tolerate `new function () { ... };` and `new Object;`.
+
+ // Environments //////////////////////////////////////////////////////////////
+
+ "browser" : false, // Defines globals exposed by modern browsers.
+ "couch" : false, // Defines globals exposed by CouchDB.
+ "devel" : false, // Allow developments statements e.g. `console.log();`.
+ "dojo" : false, // Defines globals exposed by the Dojo Toolkit.
+ "jquery" : false, // Defines globals exposed by the jQuery.
+ "mootools" : false, // Defines globals exposed by the MooTools.
+ "node" : true, // Defines globals exposed when running under Node.JS.
+ "nonstandard" : false, // Defines non-standard but widely adopted globals such as escape and unescape.
+ "prototypejs" : false, // Defines globals exposed by the Prototype.
+ "rhino" : false, // Defines globals exposed when running under Rhino.
+ "wsh" : false, // Defines globals exposed when running under WSH.
+
+ // Legacy ////////////////////////////////////////////////////////////////////
+
+ "nomen" : false, // Prohibit use of initial or trailing underbars in names.
+ "onevar" : false, // Allow only one `var` statement per function.
+ "passfail" : false, // Stop on first error.
+ "white" : false, // Check against strict whitespace and indentation rules.
+
+ // Undocumented //////////////////////////////////////////////////////////////
+
+ "maxerr" : 100, // Maximum error before stopping.
+ "indent" : 2 // Specify indentation spacing.
+}
View
@@ -0,0 +1,20 @@
+#
+# tbwdjs - Makefile
+# @author tom@goochesa.de (Tom Regner)
+#
+PYTHON ?= python
+JSLINT ?= gjslint
+
+bootstrap:
+ @npm install -d
+
+jshint: node_modules/.bin/jshint
+ @node_modules/.bin/jshint lib/
+
+jslint:
+ @gjslint --unix_mode --strict --nojsdoc -r lib
+
+node_modules/.bin/jshint:
+ @npm install jshint
+
+.PHONY: jslint jshint bootstrap
View
@@ -10,9 +10,6 @@ var http = require('http');
var qs = require('querystring');
var assert = require('assert');
-var console = require('console');
-var util = require('util');
-
/**
* create a testingbot webdriver client
@@ -28,10 +25,9 @@ exports.remote = function(options) {
webjsEnd(function() {
var name = options.name || 'unnamed';
if (fn) { fn(); }
- console.log(util.inspect(client._errors));
var postData = qs.stringify({
- client_key: client.desiredCapabilities['api_key'],
- client_secret: client.desiredCapabilities['api_secret'],
+ client_key: client.desiredCapabilities.api_key,
+ client_secret: client.desiredCapabilities.api_secret,
session_id: client.sessionId,
success: client._errors.length === 0,
name: name,

0 comments on commit e22652c

Please sign in to comment.