Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pennlabs/pre-commit-hooks
A collection of pre commit hooks used within Labs
https://github.com/pennlabs/pre-commit-hooks
Last synced: about 6 hours ago
JSON representation
A collection of pre commit hooks used within Labs
- Host: GitHub
- URL: https://github.com/pennlabs/pre-commit-hooks
- Owner: pennlabs
- License: mit
- Created: 2019-11-28T23:28:03.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-04-21T18:03:49.000Z (7 months ago)
- Last Synced: 2024-04-21T23:36:32.420Z (7 months ago)
- Language: Python
- Size: 11.7 KB
- Stars: 0
- Watchers: 13
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pre-commit-hooks
This repo contains (mirrors of) various pre-commit hooks used by Penn Labs. We are using [pre-commit](https://pre-commit.com/) to handle the installation of these hooks.
The [template repositories](github.com/pennlabs/templates) provided by Penn Labs contain config files to enable suggested pre-commit hooks.
## Installation
* Install pre-commit `pip3 install pre-commit`
* `cd` into a repository with a defined `.pre-commit-config.yaml` and run `pre-commit install`Now the defined pre-commit hooks will run whenever you attempt to make a commit in that repository.
## Usage
After installing the pre-commit hooks, use git as you normally would. The only difference is when trying to run a `git commit` you should see something like this:
```bash
detect-private-key.............................................Passed
black..........................................................Passed
isort..........................................................Failed
```If all the hooks pass, then the commit will be created exactly as if you didn't have any hooks installed. However, if there's a failure, you'll have to fix the issues before being able to commit. Some of the hooks will autofix issues for you, in order to see what they changed, just run `git diff`