Skip to main content

Flexible Git Pre-Commit Hooks

Project description

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:

  1. pip install gitpatrol

  2. cd {location/of/your/repo}

  3. gitpatrol init

  4. Add a gitpatrol.toml file to root folder (samples are here)

  5. Make some changes to some files in your repo that do not respect the checkers in your gitpatrol.toml file

  6. Stage your changes for commit

  7. git commit

  8. You should get output that looks like this: Git Patrol output

  9. The value in quotations marks at the beginning of each line is the offending character sequence, which your checker found

  10. The values in parentheses reference the checkers defined in the gitpatrol.toml file, which have found a problem with your commit

  11. 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

  1. Clone the project from its GitHub repo

  2. pip install -r dev-requirements

  3. nosetests

  4. nosetests --with-coverage --cover-html --cover-branches (runs with coverage)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gitpatrol-0.0.2.tar.gz (5.8 kB view details)

Uploaded Source

File details

Details for the file gitpatrol-0.0.2.tar.gz.

File metadata

  • Download URL: gitpatrol-0.0.2.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for gitpatrol-0.0.2.tar.gz
Algorithm Hash digest
SHA256 d43a06adb67b23476a0915d60f71d03c3cbade6bb2314accea99caf72ec306db
MD5 0acc0de242af7adb0b522196e32e2eb0
BLAKE2b-256 c677383e0800b6f93ef672751e26c876df7a331e16ba38df102b44ac9bdba149

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page