From 3dc8bc87fce95981472a85f4620611d8abc69b5b Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Tue, 15 Nov 2016 16:00:40 -0800 Subject: [PATCH 1/3] [Build] Add jscs html reporter Fixes #1314 --- gulpfile.js | 1 + package.json | 1 + 2 files changed, 2 insertions(+) diff --git a/gulpfile.js b/gulpfile.js index d3d6b5d21dd..f7c6b0082e4 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -130,6 +130,7 @@ gulp.task('checkstyle', function () { return gulp.src(paths.scripts) .pipe(jscs()) .pipe(jscs.reporter()) + .pipe(jscs.reporter('jscs-html-reporter')) .pipe(jscs.reporter('fail')); }); diff --git a/package.json b/package.json index c46c79de0a4..ed9b9b2ecdb 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "gulp-sass": "^2.2.0", "gulp-sourcemaps": "^1.6.0", "jasmine-core": "^2.3.0", + "jscs-html-reporter": "^0.1.0", "jsdoc": "^3.3.2", "jshint": "^2.7.0", "karma": "^0.13.3", From 2991e9894db714c5eba21699dd9f11826c991cf6 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Wed, 16 Nov 2016 09:28:56 -0800 Subject: [PATCH 2/3] [Build] Move report to correct location --- gulpfile.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index f7c6b0082e4..225d2367e38 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -126,12 +126,18 @@ gulp.task('lint', function () { gulp.task('checkstyle', function () { var jscs = require('gulp-jscs'); + var mkdirp = require('mkdirp'); + var reportName = 'jscs-html-report.html'; + var reportPath = path.resolve(paths.reports, 'checkstyle', reportName); + var moveReport = fs.rename.bind(fs, reportName, reportPath, _.noop); + + mkdirp.sync(path.resolve(paths.reports, 'checkstyle')); return gulp.src(paths.scripts) .pipe(jscs()) .pipe(jscs.reporter()) - .pipe(jscs.reporter('jscs-html-reporter')) - .pipe(jscs.reporter('fail')); + .pipe(jscs.reporter('jscs-html-reporter')).on('finish', moveReport) + .pipe(jscs.reporter('fail')) }); gulp.task('fixstyle', function () { From 242eb6d733cd529bcbe3e21f3b2299b024a94650 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Wed, 16 Nov 2016 09:36:22 -0800 Subject: [PATCH 3/3] [Build] Restore missing semicolon Semicolons are our friends. --- gulpfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index 225d2367e38..380f2337583 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -137,7 +137,7 @@ gulp.task('checkstyle', function () { .pipe(jscs()) .pipe(jscs.reporter()) .pipe(jscs.reporter('jscs-html-reporter')).on('finish', moveReport) - .pipe(jscs.reporter('fail')) + .pipe(jscs.reporter('fail')); }); gulp.task('fixstyle', function () {