@@ -20,6 +20,10 @@ 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.
26
+ #
23
27
# Consider adding aliases to longer-named hooks for easier CLI usage.
24
28
# ==========================================================================
25
29
- repo : https://github.com/tekwizely/pre-commit-golang
@@ -121,17 +125,17 @@ For file and repo-based hooks, this isn't an issue, but for module and package-b
121
125
# ## Useful Hook Parameters
122
126
```
123
127
- id: hook-id
124
- args: [ "--", arg1, arg2, ...] # Pass options (after "--" )
128
+ args: [ arg1, arg2, ..., '--' ] # Pass options (end with '--' )
125
129
always_run: true # Run even if no matching files staged
126
130
alias: hook-alias # Create an alias
127
131
```
128
132
129
133
#### Passing Options To Hooks
130
134
You can pass options into individual hooks to customize tool behavior.
131
135
132
- Use a leading `"--" ` argument to separate the hook options from the modified-file list that Pre-Commit passes into the hook.
136
+ Use a trailing `'--' ` argument to separate the hook options from the modified-file list that Pre-Commit passes into the hook.
133
137
134
- For repo-based hooks, the `-- ` is optional
138
+ For repo-based hooks, the `'--' ` is optional
135
139
136
140
See each hook's description below for some popular options that you might want to use.
137
141
0 commit comments