How do I configure arguments for a given hook?
See original GitHub issueApologies if the question looks too simple. I’m new to pre-commit.
I followed these steps to set things up:
brew install pre-commit
cd my_repo
pre-commit install
and then created a .pre-commit-config.yaml
file inside my_repo
with the following contents:
- repo: git://github.com/pre-commit/pre-commit-hooks
sha: v1.2.0 # Use the ref you want to point at
hooks:
- id: check-added-large-files
My understanding is that check-added-large-files
supports arguments args: ['--maxkb=123']
.
I would like to set up the hook so that it prevents me from committing files larger than 50MB any time I try to git commit anything on the repo. Where exactly do I specify these arguments?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Git Hooks - Git SCM
The post-rewrite hook is run by commands that replace commits, such as git commit --amend and git rebase (though not by git filter-branch...
Read more >Rules of Hooks - React
Hooks are JavaScript functions, but you need to follow two rules when ... Read the name state variable (argument is ignored) useEffect(persistForm) //...
Read more >Writing hook functions — pytest documentation
Hooks receive parameters using only keyword arguments. Now your hook is ready to be used. To register a function at the hook, other...
Read more >Git Hooks | Atlassian Git Tutorial
All Git hooks are ordinary scripts that Git executes when certain events occur in the repository. This makes them very easy to install...
Read more >before_record hook - Vcr - Relish
Your block should accept up to 2 arguments. ... select which cassettes a given hook applies to. ... VCR.configure do |c| c.before_record(:twitter) {...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You’ll add those args to the hook dictionary itself – it’ll look something like this:
The full docs for this can be found here: Passing arguments to hooks
you’ve got invalid yaml there 😃
here’s (I think) what you want: