build-workflow
Advanced tools
Comparing version 0.0.24 to 0.0.25
@@ -20,3 +20,3 @@ # Usage | ||
# install the check-valid tasks | ||
npm i -D grunt-contrib-jshint grunt-jscs grunt-jsvalidate https://github.com/royriojas/grunt-jsbeautifier/tarball/e69f6ef | ||
npm i -D grunt-newer grunt-contrib-jshint grunt-jscs grunt-jsvalidate https://github.com/royriojas/grunt-jsbeautifier/tarball/e69f6ef | ||
@@ -23,0 +23,0 @@ # optional to enable a nice reporter that group errors per file |
{ | ||
"name": "build-workflow", | ||
"version": "0.0.24", | ||
"version": "0.0.25", | ||
"description": "Simple gruntfile helper to define build workflows", | ||
@@ -49,3 +49,4 @@ "main": "config-loader.js", | ||
"grunt-jsonlint": "~1.0.4", | ||
"grunt-contrib-clean": "~0.6.0" | ||
"grunt-contrib-clean": "~0.6.0", | ||
"grunt-newer": "~0.7.0" | ||
}, | ||
@@ -52,0 +53,0 @@ "docco_husky": { |
@@ -7,2 +7,3 @@ module.exports = function ( grunt, pkg, options ) { | ||
var path = require( 'path' ); | ||
var checkFiles = require( '../utils/check-files' ); | ||
@@ -12,28 +13,10 @@ gruntTaskUtils.registerTasks( { | ||
var key = 'js-check'; | ||
jsTasks = jsTasks || 'jsbeautifier,jscs,jshint,jsvalidate'; | ||
jsTasks = jsTasks.split( ',' ); | ||
var tasksToRun = []; | ||
var prepush = options.commonConfig.filesToValidate || {}; | ||
jsTasks.forEach(function ( task ) { | ||
var files = prepush[ task ] || []; | ||
if ( files.length > 0 ) { | ||
var tConfig = { | ||
src: files | ||
}; | ||
grunt.config.set( [ task, key ], tConfig ); | ||
tasksToRun.push( task ); | ||
} | ||
var opts = this.options( { | ||
useNewer: true, | ||
tasksToRun: 'jsbeautifier,jscs,jshint,jsvalidate', | ||
filesToValidate: options.commonConfig.filesToValidate, | ||
forceBeautify: true | ||
} ); | ||
tasksToRun = tasksToRun.map(function ( task ) { | ||
return task + ':' + key; | ||
} ); | ||
var tasksToRun = checkFiles.doCheck( grunt, jsTasks, opts ); | ||
@@ -44,7 +27,5 @@ if ( tasksToRun.length > 0 ) { | ||
console.log( 'tasks to run', tasksToRun ); | ||
grunt.log.ok( 'all validated!' ); | ||
grunt.log.ok( 'check-valid: tasks to run', tasksToRun ); | ||
} | ||
} ); | ||
}; |
@@ -7,2 +7,3 @@ module.exports = function ( grunt, pkg, options ) { | ||
var path = require( 'path' ); | ||
var checkFiles = require( '../utils/check-files' ); | ||
@@ -12,37 +13,10 @@ gruntTaskUtils.registerTasks( { | ||
var key = 'js-check'; | ||
jsTasks = jsTasks || 'jsbeautifier,jscs,jshint,jsvalidate'; | ||
jsTasks = jsTasks.split( ',' ); | ||
var tasksToRun = []; | ||
var prepush = options.commonConfig.filesToValidate || {}; | ||
jsTasks.forEach(function ( task ) { | ||
var files = prepush[ task ] || []; | ||
if ( files.length > 0 ) { | ||
var tConfig = { | ||
src: files | ||
}; | ||
if ( task === 'jsbeautifier' && !grunt.option( 'pp-force-beautify' )) { | ||
tConfig.options = { | ||
mode: 'VERIFY_ONLY', | ||
onVerificationFailed: function ( result, opts ) { | ||
grunt.fail.fatal( 'File needed beautification: ' + opts.file ); | ||
} | ||
}; | ||
} | ||
grunt.config.set( [ task, key ], tConfig ); | ||
tasksToRun.push( task ); | ||
} | ||
var opts = this.options( { | ||
useNewer: false, | ||
tasksToRun: 'jsbeautifier,jscs,jshint,jsvalidate', | ||
filesToValidate: options.commonConfig.filesToValidate, | ||
forceBeautify: false | ||
} ); | ||
tasksToRun = tasksToRun.map(function ( task ) { | ||
return task + ':' + key; | ||
} ); | ||
var tasksToRun = checkFiles.doCheck( grunt, jsTasks, opts ); | ||
@@ -53,5 +27,5 @@ if ( tasksToRun.length > 0 ) { | ||
console.log( 'tasks to run', tasksToRun ); | ||
grunt.log.ok( 'prepush: tasks to run', tasksToRun ); | ||
} | ||
} ); | ||
}; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
158363
93
2190
22