From 561707c7c14fca03fe77ea1bf8f9231ec832a383 Mon Sep 17 00:00:00 2001 From: Evgeniy Negometyanov Date: Wed, 11 Nov 2015 18:39:04 +0200 Subject: [PATCH] Fail reporters fixes --- gulpfile.js | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 6d6586d61..542f0cf44 100755 --- a/gulpfile.js +++ b/gulpfile.js @@ -41,23 +41,30 @@ gulp.task('scss:watch', function () { // ############################################################################# // LINTING +gulp.task('jscs:fix', function () { + return gulp.src(PROJECT_PATH.js + '**/*.js') + .pipe(jscs({fix: true})) + .pipe(gulp.dest(PROJECT_PATH.js)); +}); + +gulp.task('jscs', function () { + return gulp.src(PROJECT_PATTERNS.lint) + .pipe(jscs()) + .pipe(jscs.reporter()) + .pipe(jscs.reporter('fail')); +}); + gulp.task('lint', function () { return gulp.src(PROJECT_PATTERNS.lint) .pipe(jshint('.jshintrc')) .pipe(jshint.reporter(stylish)) - .pipe(jscs('.jscsrc')) - .on('error', function (error) { - gutil.log('\n' + error.message); - if (process.env.CI) { - process.exit(1); - } - }); + .pipe(jshint.reporter('fail')); }); gulp.task('lint:watch', function () { - gulp.watch(PROJECT_PATTERNS.lint, ['lint']); + gulp.watch(PROJECT_PATTERNS.lint, ['lint', 'jscs']); }); gulp.task('compile', ['scss']); gulp.task('watch', ['scss:watch', 'lint:watch']); -gulp.task('ci', ['lint']); +gulp.task('ci', ['lint', 'jscs']);