Skip to content

Commit 66f3086

Browse files
committed
Updated docs re: option seperator
1 parent 5eda8c0 commit 66f3086

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ You can copy/paste the following snippet into your `.pre-commit-config.yaml` fil
2020
# Visit the project home page to learn more about the available Hooks,
2121
# including useful arguments you might want to pass into them.
2222
#
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+
#
2327
# Consider adding aliases to longer-named hooks for easier CLI usage.
2428
# ==========================================================================
2529
- 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
121125
### Useful Hook Parameters
122126
```
123127
- id: hook-id
124-
args: ["--", arg1, arg2, ...] # Pass options (after "--")
128+
args: [arg1, arg2, ..., '--'] # Pass options (end with '--')
125129
always_run: true # Run even if no matching files staged
126130
alias: hook-alias # Create an alias
127131
```
128132
129133
#### Passing Options To Hooks
130134
You can pass options into individual hooks to customize tool behavior.
131135
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.
133137
134-
For repo-based hooks, the `--` is optional
138+
For repo-based hooks, the `'--'` is optional
135139
136140
See each hook's description below for some popular options that you might want to use.
137141

sample-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@ repos:
5353
#
5454
# Useful Hook Parameters:
5555
# - id: hook-id
56-
# args: ["--", arg1, arg2, ...] # Pass options (after "--")
56+
# args: [arg1, arg2, ..., '--'] # Pass options (end with '--')
5757
# always_run: true # Run even if no matching files staged
5858
# alias: hook-alias # Create an alias
5959
#
6060
# Passing Options To Hooks:
6161
# You can pass options into individual hooks to customize tool behavior.
62-
# Use a leading `"--"` argument to separate the hook options from the
62+
# Use a trailing '--' argument to separate the hook options from the
6363
# modified-file list that Pre-Commit passes into the hook.
64-
# For repo-based hooks, the `--` is optional.
64+
# For repo-based hooks, the '--' is optional.
6565
#
6666
# Always Run:
6767
# By default, hooks ONLY run when matching file types are staged.

0 commit comments

Comments
 (0)