Skip to content

Commit

Permalink
Merge pull request #401 from erfannariman/explanation-about-local-hooks
Browse files Browse the repository at this point in the history
Explanation about local hooks
  • Loading branch information
asottile committed Oct 10, 2020
2 parents bd0ed1f + b5ad0c9 commit 6345420
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion index.mako
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ file that tells pre-commit:
the hook passes. _new in 1.6.0_.
=r=
=c= [`pass_filenames`](_#hooks-pass_filenames)
=c= (optional: default `true`) if `false` no arguments will be passed to
=c= (optional: default `true`) if `false` no filenames will be passed to
the hook.
=r=
=c= [`require_serial`](_#hooks-require_serial)
Expand Down Expand Up @@ -1267,6 +1267,22 @@ If the [`args`](#config-args) property is empty or not defined, your script will
path/to/script-or-system-exe dir/file1 dir/file2 file3
```
When creating local hooks, there's no reason to put command arguments
into [`args`](#config-args) as there is nothing which can override them --
instead put your arguments directly in the hook [`entry`](#hooks-entry).
For example:
```yaml
- repo: local
hooks:
- id: check-requirements
name: check requirements files
language: system
entry: python -m scripts.check_requirements --compare
files: ^requirements.*.txt$
```
## Repository local hooks
Repository-local hooks are useful when:
Expand Down

0 comments on commit 6345420

Please sign in to comment.