@@ -20,9 +20,11 @@ You can copy/paste the following snippet into your `.pre-commit-config.yaml` fil
20
20
# Visit the project home page to learn more about the available Hooks,
21
21
# including useful arguments you might want to pass into them.
22
22
#
23
- # When passing options to hooks, use a trailing '--' argument to separate
24
- # the hook options from the modified-file list that Pre-Commit passes in.
25
- # For repo-based hooks, the '--' is optional.
23
+ # NOTE: When passing options to hooks, if your options contain a reference
24
+ # to an existing file, then you will need to use a trailing '--'
25
+ # argument to separate the hook options from the modified-file list
26
+ # that Pre-Commit passes into the hook.
27
+ # For repo-based hooks, '--' is not needed.
26
28
#
27
29
# Consider adding aliases to longer-named hooks for easier CLI usage.
28
30
# ==========================================================================
@@ -125,17 +127,19 @@ For file and repo-based hooks, this isn't an issue, but for module and package-b
125
127
# ## Useful Hook Parameters
126
128
```
127
129
- id: hook-id
128
- args: [ arg1, arg2, ..., '--'] # Pass options (end with '--')
130
+ args: [ arg1, arg2, ..., '--'] # Pass options ('--' is optional )
129
131
always_run: true # Run even if no matching files staged
130
132
alias: hook-alias # Create an alias
131
133
```
132
134
133
135
#### Passing Options To Hooks
134
136
You can pass options into individual hooks to customize tool behavior.
135
137
136
- Use a trailing `'--'` argument to separate the hook options from the modified-file list that Pre-Commit passes into the hook.
138
+ If your options contain a reference to an existing file, then you
139
+ will need to use a trailing `'--'` argument to separate the hook options from
140
+ the modified-file list that Pre-Commit passes into the hook.
137
141
138
- For repo-based hooks, the `'--'` is optional
142
+ **NOTE:** For repo-based hooks, `'--'` is not needed.
139
143
140
144
See each hook's description below for some popular options that you might want to use.
141
145
0 commit comments