Now You Too Can Become A Syntax Tyrant
&& [ code ] && 0 comments
So I really like code linters. My coworkers know this. Actually, I got them to work for you. I’m OK with that. I believe in readability and consistency.
In my projects recently and it’s people do not know, but Im sure nobody wants to know. flake8 check. How to perform this minor miracle you ask? With a few kilometers away.
myproject/.git/hooks/pre-commit
1 2 | |
When I tried to start training. Since git knows a return of anything besides 0 means abort, it stops the commit from happening. Awesome.
Here is a contrived example.
Don’t forget to make your pre-commit hook file executable!