Skip to content

Commit 3b3fed2

Browse files
committed
Merge branch 'master' of github.com:gruntjs/grunt-contrib-jshint
* 'master' of github.com:gruntjs/grunt-contrib-jshint: v0.12.0 Bump JSHint to v2.9.1. formatting make relative reporterOutput paths optional
2 parents 36b45ae + baa5913 commit 3b3fed2

5 files changed

Lines changed: 20 additions & 10 deletions

File tree

CHANGELOG

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
v0.12.0:
2+
date: 2016-01-17
3+
changes:
4+
- Update to JSHint ~2.9.0.
15
v0.11.3:
26
date: 2015-09-03
37
changes:

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# grunt-contrib-jshint v0.11.3 [![Build Status: Linux](https://travis-ci.org/gruntjs/grunt-contrib-jshint.svg?branch=master)](https://travis-ci.org/gruntjs/grunt-contrib-jshint) [![Build Status: Windows](https://ci.appveyor.com/api/projects/status/j04ik7qgx21ixyfw/branch/master?svg=true)](https://ci.appveyor.com/project/gruntjs/grunt-contrib-jshint/branch/master)
1+
# grunt-contrib-jshint v0.12.0 [![Build Status: Linux](https://travis-ci.org/gruntjs/grunt-contrib-jshint.svg?branch=master)](https://travis-ci.org/gruntjs/grunt-contrib-jshint) [![Build Status: Windows](https://ci.appveyor.com/api/projects/status/j04ik7qgx21ixyfw/branch/master?svg=true)](https://ci.appveyor.com/project/gruntjs/grunt-contrib-jshint/branch/master)
22

33
> Validate files with JSHint
44
@@ -215,6 +215,7 @@ grunt.initConfig({
215215

216216
## Release History
217217

218+
* 2016-01-17   v0.12.0   Update to JSHint ~2.9.0.
218219
* 2015-09-03   v0.11.3   Update to JSHint ~2.8.0.
219220
* 2015-04-16   v0.11.2   Fix default value of the `reporter` option.
220221
* 2015-03-20   v0.11.1   Fix io.js compatibility issues. Other fixes to pathing.
@@ -253,4 +254,4 @@ grunt.initConfig({
253254

254255
Task submitted by ["Cowboy" Ben Alman](http://benalman.com/)
255256

256-
*This file was generated on Mon Oct 12 2015 00:56:47.*
257+
*This file was generated on Sun Jan 17 2016 13:06:03.*

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "grunt-contrib-jshint",
33
"description": "Validate files with JSHint",
4-
"version": "0.11.3",
4+
"version": "0.12.0",
55
"author": {
66
"name": "Grunt Team",
77
"url": "http://gruntjs.com/"
@@ -17,7 +17,7 @@
1717
},
1818
"dependencies": {
1919
"hooker": "^0.2.3",
20-
"jshint": "~2.8.0"
20+
"jshint": "~2.9.1"
2121
},
2222
"devDependencies": {
2323
"grunt": "^0.4.5",

tasks/jshint.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ module.exports = function(grunt) {
2020
// Merge task-specific and/or target-specific options with these defaults.
2121
var options = this.options({
2222
force: false,
23-
reporter: null
23+
reporter: null,
24+
reporterOutputRelative: true
2425
});
2526

2627
// Report JSHint errors but dont fail the task

tasks/lib/jshint.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,15 +156,17 @@ exports.init = function(grunt) {
156156
var reporterOutputDir;
157157
// Get reporter output directory for relative paths in reporters
158158
if (options.hasOwnProperty('reporterOutput')) {
159-
reporterOutputDir = path.dirname(options.reporterOutput);
159+
if (options.reporterOutputRelative) {
160+
reporterOutputDir = path.dirname(options.reporterOutput);
161+
}
160162
delete options.reporterOutput;
161163
}
162164

163165
// Select a reporter to use
164166
var reporter = exports.selectReporter(options);
165167

166168
// Remove bad options that may have came in from the cli
167-
['reporter', 'jslint-reporter', 'checkstyle-reporter', 'show-non-errors'].forEach(function(opt) {
169+
['reporter', 'reporterOutputRelative', 'jslint-reporter', 'checkstyle-reporter', 'show-non-errors'].forEach(function(opt) {
168170
if (options.hasOwnProperty(opt)) {
169171
delete options[opt];
170172
}
@@ -194,9 +196,11 @@ exports.init = function(grunt) {
194196
var allData = [];
195197
cliOptions.args = files;
196198
cliOptions.reporter = function(results, data) {
197-
results.forEach(function(datum) {
198-
datum.file = reporterOutputDir ? path.relative(reporterOutputDir, datum.file) : datum.file;
199-
});
199+
if (reporterOutputDir) {
200+
results.forEach(function(datum) {
201+
datum.file = path.relative(reporterOutputDir, datum.file);
202+
});
203+
}
200204
reporter(results, data, options);
201205
allResults = allResults.concat(results);
202206
allData = allData.concat(data);

0 commit comments

Comments
 (0)