Python Pre-Commit Hooks Setup in a single video!
ฝัง
- เผยแพร่เมื่อ 22 พ.ย. 2024
- Hey everyone!
A one-stop-shop for setting up and configuring Python Pre-commit git hooks in one video. Adding it to a repo, setting it up and running hooks on each commit.
Pre-Commit used in a repo: github.com/IVI... 👈
Pre-Commit: pre-commit.com/
🎞Playlists 🎞###
React Website Series - • How to start a Softwar...
SWE Career: • How to Prepare for Sof...
Python Automation Series - • Python Automation Fold...
📚Recommended Books 📚###
1. Crack The Coding Interview - amzn.to/2zh2ztq
2. Grokking Algorithms - amzn.to/2ZvkwPk
3. Clean Code - amzn.to/2Tx7ugo
4. Show Your Work! - amzn.to/31MdqY4
👨🏻💻 Social Media 👨🏻💻###
📷Instagram - / haydnmurray
🐤Twitter - / engineerhaydn
💻My Gear 💻###
🎤 Microphone - amzn.to/3d06nh1
🎥 Camera - amzn.to/3c0zoIi
🔉 Speaker - amzn.to/2zpQrGp
🖱 Mouse - amzn.to/3c0ADXY
🐭 Mouse Mat - amzn.to/2LTJ4tr
💾 HDD Backup - amzn.to/2TAc65B
💽 CPU - amzn.to/3bXuXhh
💨 CPU Cooler - amzn.to/36t1JWv
💼 PC Case - amzn.to/2TBcFvX
Music: www.bensound.com
Awesome video, mate.
Clean structured, well spoken and nice visual tutorial.
Subbed :)
Legend - thank you mate! 👍
Thanks! :) Looking forward to seeing more content.
Glad you enjoyed it! 👍
Video starts at 1:11.
Nice and simple video, great stuff
Thanks for the nice comment 👍
Super useful, thanks!
Thank you!
Awesome 👌🏽
Hello Haydn, thanks for this super helpful video. Could I ask a question? How do you know which arguments are allowed for each hook? Is there a way to query this from command line?
You can type eve cmd -help or eve cmd -help I think; I’m pretty sure I do it in my videos at some point! 😀
Amazing! This was really helpful. Thank you
Thanks so much!
Awesome video. Thanks
excellent work!
Thanks for the comment! Glad you enjoyed it 👍
thanks for this video, can i ask a question?
i have use it but when i run it with all files it said(( An error has occurred: InvalidConfigError:
=====> .pre-commit-config.yaml is not a file))
Nice video !!
How do i automate the process of 'pre-commit install' so whenever someone clones my repo, the hooks are already added for them in the .git folder?
Great vid :)
Thank you!
Hi Haydn, nice explanation. I have a request for pre-commit hooks with 2 parameters to pass. Could you please help !
1. If the file size being committed is more than CommitMaxFileSizeInMB, git should prevent the file(s) from commit.
2. Comma separated file paths. If the files committed are separated by commas, git should prevent the files from commit.
I think you can make your own pre-commit hooks but I think you might want to Google actual git hooks because I think you can create your own .sh scripts
Hello Haydn, how can I apply this only to files with a .json extension?
Hi Zee, I believe you want to use the filter by types - pre-commit.com/#filtering-files-with-types
Very good!
Thank you! Glad you liked it 👍
i installed pre-commit using pip but when I run pre-commit --version it shows error that "not recognized as the name of a cmdlet...."
Hmm, sorry I've not come across this before - hope you found a solution!
When I did the same, it is working but if someone else is trying to commit the pre commit hooks are not working for them. Do they need to install or do something
Hey - yes, they’ll need to install the hooks ‘pre-commit install’ before they can use them. I couldn’t figure out a clean way to make them easily shareable, sorry
@@haydn.murray thanks for this quick reply...
thanks