grunt-jscs-checker
Advanced tools
Comparing version 0.3.0 to 0.3.1
@@ -0,0 +0,0 @@ ### Code style |
@@ -28,3 +28,3 @@ module.exports = function( grunt ) { | ||
}, | ||
all: [ "Gruntfile.js", "tasks/*.js", "test/*.js" ] | ||
all: [ "Gruntfile.js", "tasks/**/*.js", "test/*.js", "test/enmasse/Gruntfile.js" ] | ||
}, | ||
@@ -31,0 +31,0 @@ jscs: { |
{ | ||
"name": "grunt-jscs-checker", | ||
"description": "Grunt task for checking JavaScript Code Style with jscs.", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"author": { | ||
"name": "Gustavo Henke", | ||
"email": "gustavo@injoin.com.br", | ||
"url": "https://github.com/gustavohenke" | ||
}, | ||
"contributors": [{ | ||
"name": "Oleg", | ||
"email": "markelog@gmail.com" | ||
}], | ||
"repository": { | ||
@@ -17,4 +22,4 @@ "type": "git", | ||
"dependencies": { | ||
"jscs": "1.1.0", | ||
"vow": "0.3.12", | ||
"jscs": "1.2.0", | ||
"vow": "0.4.0", | ||
"hooker": "0.2.3", | ||
@@ -21,0 +26,0 @@ |
@@ -7,3 +7,2 @@ # grunt-jscs-checker | ||
[![NPM version](https://badge.fury.io/js/grunt-jscs-checker.png)](http://badge.fury.io/js/grunt-jscs-checker) | ||
[![Stories in Ready](https://badge.waffle.io/gustavohenke/grunt-jscs-checker.png?label=ready)](http://waffle.io/gustavohenke/grunt-jscs-checker) | ||
@@ -10,0 +9,0 @@ ## Getting started |
@@ -1,5 +0,4 @@ | ||
"use stirct"; | ||
"use strict"; | ||
var path = require( "path" ), | ||
utils = require( "util" ), | ||
@@ -72,3 +71,3 @@ Checker = require( "jscs/lib/checker" ), | ||
return checkPath; | ||
} | ||
}; | ||
@@ -99,3 +98,3 @@ /** | ||
return config; | ||
} | ||
}; | ||
@@ -118,3 +117,3 @@ /** | ||
return {}; | ||
} | ||
}; | ||
@@ -126,6 +125,7 @@ /** | ||
JSCS.prototype.getOptions = function() { | ||
var _options = {}; | ||
var option, | ||
_options = {}; | ||
// Copy options to another object so this method would not be destructive | ||
for ( var option in this.options ) { | ||
for ( option in this.options ) { | ||
@@ -135,3 +135,3 @@ // If to jscs would be given a grunt task option | ||
if ( !~taskOptions.indexOf( option ) ) { | ||
_options[ option ] = this.options[ option ] | ||
_options[ option ] = this.options[ option ]; | ||
} | ||
@@ -141,3 +141,3 @@ } | ||
return _options; | ||
} | ||
}; | ||
@@ -169,3 +169,3 @@ /** | ||
grunt.fatal( "Reporter \"" + name + "\" does not exist" ); | ||
}, | ||
}; | ||
@@ -178,3 +178,3 @@ /** | ||
return this._reporter; | ||
} | ||
}; | ||
@@ -193,3 +193,3 @@ /** | ||
return this; | ||
} | ||
}; | ||
@@ -202,3 +202,3 @@ /** | ||
return this._errors; | ||
} | ||
}; | ||
@@ -218,3 +218,3 @@ /** | ||
return result; | ||
} | ||
}; | ||
@@ -227,3 +227,4 @@ /** | ||
var options = this.options, | ||
shouldHook = options.reporter && options.reporterOutput; | ||
shouldHook = options.reporterOutput, | ||
content = ""; | ||
@@ -233,3 +234,3 @@ if ( shouldHook ) { | ||
pre: function( out ) { | ||
grunt.file.write( options.reporterOutput, out ); | ||
content += out; | ||
@@ -244,2 +245,3 @@ return hooker.preempt(); | ||
if ( shouldHook ) { | ||
grunt.file.write( options.reporterOutput, content ); | ||
hooker.unhook( process.stdout, "write" ); | ||
@@ -249,3 +251,3 @@ } | ||
return this; | ||
} | ||
}; | ||
@@ -267,5 +269,5 @@ /** | ||
return this; | ||
} | ||
}; | ||
return JSCS; | ||
} | ||
}; |
@@ -222,3 +222,3 @@ "use strict"; | ||
pre: function( message ) { | ||
test.ok( message, "Reporter report something" ); | ||
test.ok( message, "Reporter should report something" ); | ||
test.done(); | ||
@@ -235,2 +235,26 @@ | ||
"Default reporter should be outputable to the file (#23)": function( test ) { | ||
var jscs = new JSCS({ | ||
reporterOutput: "#23", | ||
"requireCurlyBraces": [ "while" ], | ||
}); | ||
jscs.check( "test/fixtures/fixture.js" ).then(function( errorsCollection ) { | ||
// "grunt-contrib-nodeunit" package through which these tests are run, | ||
// mutes grunt log actions so it wouldn't interfeare with tests output, | ||
// for our case this is not ideal since our default reporter uses grunt.log functions | ||
// this value will be changed when next test is run, | ||
// so there is no need to do this globally | ||
grunt.log.muted = false; | ||
jscs.setErrors( errorsCollection ).report(); | ||
test.ok( grunt.file.read( "#23" ).length, "all output should be directed to the file" ); | ||
grunt.file.delete( "#23" ); | ||
test.done(); | ||
}); | ||
}, | ||
notify: function( test ) { | ||
@@ -292,2 +316,4 @@ hooker.hook( grunt.log, "error", { | ||
test.ok( grunt.file.exists( "test.xml" ), "test.xml should exist" ); | ||
test.notEqual( grunt.file.read( "test.xml" ), "</checkstyle>\n", | ||
"test.xml should be more than last console.log" ); | ||
grunt.file.delete( "test.xml" ); | ||
@@ -294,0 +320,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
29419
668
0
32
88
+ Addedjscs@1.2.0(transitive)
+ Addedvow@0.3.130.4.0(transitive)
- Removedjscs@1.1.0(transitive)
- Removedvow@0.3.12(transitive)
Updatedjscs@1.2.0
Updatedvow@0.4.0