Skip to content

Commit

Permalink
Merge branch 'basic-grunt-support' of https://github.com/davidlinse/n…
Browse files Browse the repository at this point in the history
…ightwatch into davidlinse-basic-grunt-support

* 'basic-grunt-support' of https://github.com/davidlinse/nightwatch:
  style: remove unused require'd modules
  chore: add 'unsued:true' to .jshintrc
  chore: split complexity-task into separate tasks
  chore: remove options for unused uglify-task
  • Loading branch information
beatfactor committed Jun 14, 2014
2 parents e86feb3 + b34a4a9 commit 5560890
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 20 deletions.
3 changes: 2 additions & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
"quotmark":"single",
"indent":2,
"newcap":true,
"trailing":true
"trailing":true,
"unused":true
}
25 changes: 13 additions & 12 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,6 @@ module.exports = function(grunt) {

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),

uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
},
build: {
src: 'src/<%= pkg.name %>.js',
dest: 'build/<%= pkg.name %>.min.js'
}
},
jshint: {
options: {
jshintrc: '.jshintrc'
Expand All @@ -39,8 +29,19 @@ module.exports = function(grunt) {
src: ['tests/*.json']
},
complexity: {
generic: {
src: ['lib/**/*.js', 'examples/**/*.js'],
lib: {
src: ['lib/**/*.js'],
options: {
breakOnErrors: true,
errorsOnly: false,
cyclomatic: [12, 10, 8, 6, 4],
halstead: [30.19, 25, 20, 16, 12, 6, 3],
maintainability: 98.65, // should be 100+,
hideComplexFunctions: false
}
},
examples: {
src: ['examples/**/*.js'],
options: {
breakOnErrors: true,
errorsOnly: false,
Expand Down
1 change: 0 additions & 1 deletion bin/_clirunner.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
var Runner = require('../lib/runner/run.js');
var Logger = require('../lib/util/logger.js');
var Selenium = require('../lib/runner/selenium.js');
var util = require('util');
var fs = require('fs');
var path = require('path');

Expand Down
2 changes: 0 additions & 2 deletions bin/runner.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
/**
* Module dependencies
*/
var fs = require('fs');
var path = require('path');
var Logger = require('../lib/util/logger.js');
var cli = require('./_cli.js');
var CliRunner = require('./_clirunner.js');
Expand Down
1 change: 0 additions & 1 deletion lib/http/request.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
var util = require('util'),
events = require('events'),
qs = require('querystring'),
http = require('http'),
https = require('https'),
Logger = require('./../util/logger');
Expand Down
3 changes: 1 addition & 2 deletions lib/runner/reporters/junit.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
var fs = require('fs'),
path = require('path'),
ejs = require('ejs'),
child_process = require('child_process');
ejs = require('ejs');

exports.save = function(results, opts, callback) {
var tmpl = __dirname + '/junit.xml.ejs';
Expand Down
1 change: 0 additions & 1 deletion lib/runner/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*/
var path = require('path');
var fs = require('fs');
var util = require('util');
var mkpath = require('mkpath');
var minimatch = require('minimatch');
var Nightwatch = require('../../index.js');
Expand Down

0 comments on commit 5560890

Please sign in to comment.