@@ -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
130134You 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
136140See each hook's description below for some popular options that you might want to use.
137141
0 commit comments