Last active
October 20, 2022 00:08
-
-
Save visualjeff/36fa03d1c8d700c07c883628a7d84176 to your computer and use it in GitHub Desktop.
pre-commit setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pre-req's: | |
Python 3 | |
A project that is git initialized | |
Windozs setup: | |
pip install pre-commit | |
MAC OS setup for pre-commit: | |
brew install pre-commit | |
Project setup: | |
git config --unset-all core.hooksPath | |
pre-commit install | |
Create the .pre-commit-config.yaml file at the root of your project with the following content: | |
repos: | |
- repo: https://github.com/pre-commit/pre-commit-hooks | |
rev: v3.2.0 | |
hooks: | |
- id: trailing-whitespace | |
- id: check-added-large-files | |
- id: check-json | |
- id: check-case-conflict | |
- id: check-merge-conflict | |
- id: mixed-line-ending | |
Manually test your pre-commit: | |
pre-commit run --all-files |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment