Contents

precommit

A cheatsheet for various pre-commit hooks and things that help with linting, formatting, code scans and more. These all help “shift left” the review to eliminate more issues in the development workflow, rather than providing feedback only once the CI system is involved.

The Frameworks

Precommit

Install

A bit more complicated, depending on the Docker image used and the python tooling installed. Assuming you have pip installed, then this should work.

1
pip install pre-commit

Here’s some examples to get you started.

Lefthook

This is a newer toolkit, but as it’s written in Go and I’m working with Go, this is my current choice.

As long as you have the Go SDK installed, it’s as simple as

Install

1
go install github.com/evilmartians/[email protected]

Other installation methods are located at the installation guide 1


  1. lefthook/full_guide.md at master · evilmartians/lefthook · GitHub ↩︎


Webmentions

(No webmentions yet.)