Git Patrol
The goal is to create a plug and play git pre-commit hook that completes a bunch of basic checks, but also lints each file with its language’s respective linter.
Deeply inspired by Bob Gilmore’s githooks
Installation:
pip install gitpatrol
cd {location/of/your/repo}
gitpatrol init
Add a gitpatrol.toml file to root folder (samples are here)
Make some changes to some files in your repo that do not respect the checkers in your gitpatrol.toml file
Stage your changes for commit
git commit
You should get output that looks like this:
The value in quotations marks at the beginning of each line is the offending character sequence, which your checker found
The values in parentheses reference the checkers defined in the gitpatrol.toml file, which have found a problem with your commit
Your commit will be blocked until the checkers are happy (or you disable them)
Development
I would love it if you used the Issue Tracker to notify me of PRs you’d like to contribute to this project. There are a couple things I’d like to implement next. You can see them in the TODO.md
To run tests
Clone the project from its GitHub repo
pip install -r dev-requirements
nosetests
nosetests --with-coverage --cover-html --cover-branches (runs with coverage)
Release files for gitpatrol 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gitpatrol-0.0.2.tar.gz | 5.8 kB | Details |
Release files / gitpatrol-0.0.2.tar.gz
| Download URL | gitpatrol-0.0.2.tar.gz |
|---|---|
| Size | 5.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d43a06adb67b23476a0915d60f71d03c3cbade6bb2314accea99caf72ec306db
|
|
BLAKE2b-256 checksum How to use checksums |
c677383e0800b6f93ef672751e26c876df7a331e16ba38df102b44ac9bdba149
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |