Skip to content

Commit

Permalink
grunt lint added in pre commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mehulkaklotar committed Oct 6, 2020
1 parent 9a894e5 commit 0da5595
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ module.exports = function (grunt) {
/**
* Register tasks.
*/
grunt.registerTask('pre-commit', ['checkDependencies', 'jsvalidate', 'jshint', 'stylelint']);
grunt.registerTask('src', ['checkDependencies', 'jsvalidate', 'jshint', 'stylelint', 'sass', 'rtlcss', 'checktextdomain', /*'imagemin',*/ 'uglify', 'cssmin', 'makepot:src']);
grunt.registerTask('bp_rest', ['clean:bp_rest', 'exec:rest_api', 'copy:bp_rest_components', 'copy:bp_rest_core', 'clean:bp_rest', 'apidoc' ]);
grunt.registerTask('build', ['exec:cli', 'clean:all', 'copy:files', 'compress', 'clean:all']);
Expand Down
7 changes: 7 additions & 0 deletions contrib/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,11 @@ then
fi
fi

echo "Running Grunt..."
grunt pre-commit
if [ $? -ne 0 ]; then
echo "Grunt failed, please fix code and recommit"
exit 1
fi

exit $?

0 comments on commit 0da5595

Please sign in to comment.