Pre-Commit is a necessary evil
Pre-commit hooks are automated scripts or checks that run before you commit your code to a version control system (VCS) like Git.
They force you and your collaborators to write clean and consistent code.
To set up pre-commit you first need to have Git installed and run on your Python console the usual:
pip install pre-commit
Once installed, place in your root a file named .pre-commit-config.yaml and fill it with a collection of 'hooks'.
```yaml
rev: stable
hooks:
- id: black
```yaml
The hooks are the scripts responsible for the checks, there are many and way more evil than this.
Have fun and let everyone know how frustrating is to work with you🫡
5
6 comments
Davide Lupis
4
Pre-Commit is a necessary evil
Data Alchemy
skool.com/data-alchemy
Your Community to Master the Fundamentals of Working with Data and AI — by Datalumina®
Leaderboard (30-day)
powered by