Created
August 14, 2016 09:05
-
-
Save christian-acuna/d604da5a1791b87462ab37871d5fb0e1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var args = require('yargs').argv; | |
var config = require('./gulp.config')(); //require and execute it | |
var $ = require('gulp-load-plugins')({lazy: true}); | |
var paths = { | |
js : ['*.js', 'src/**/*.js'] | |
}; | |
gulp.task('vet', function() { | |
log('Analyzing source with JSHint and JSCS'); | |
return gulp | |
.src(config.alljs) | |
.pipe($.if(args.verbose, $.print())) | |
.pipe($.jscs()) | |
.pipe($.jscs.reporter()) | |
.pipe($.jshint()) | |
.pipe($.jshint.reporter('jshint-stylish', { | |
verbose: true | |
})) | |
.pipe($.jshint.reporter('fail')); | |
}); | |
//////////// | |
function log(msg) { | |
if (typeof(msg) === 'object') { | |
for (var item in msg) { | |
if (msg.hasOwnProperty(item)) { | |
$.util.log($.util.colors.blue(msg[item])); | |
} | |
} | |
} else { | |
$.util.log($.util.colors.blue(msg)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment