Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -706,9 +706,12 @@ task. This version, specifically invoked by `validate:staged` attempts to
minimize the number of files scanned by checking only those that have changed
since the last successful commit.

#### Configuring Additional Tasks
#### Configuring Git Hooks

**config.git.hooks**: An array of grunt tasks to run on pre-commit.
**config.git.hooks**: An array of grunt tasks to run on pre-commit in addition to `validate:staged`.

**config.git.hook-command**: A substitute for a simple `grunt` command to handle the individual grunt tasks.
Allows specification of more complex bin paths or execution wrappers such as `time` or `docker-compose`.

#### Overriding a Commit Rejection

Expand Down
3 changes: 3 additions & 0 deletions tasks/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ module.exports = function(grunt) {

// Githooks task may be configured via Gruntconfig.
grunt.config('githooks', {
options: {
command: grunt.config('config.git.hook-command') || 'grunt'
},
gdt: {
'pre-commit': _.unique(tasks).join(' ')
}
Expand Down