I just migrated from black, and I'm using the same way as before -- pre-commit. It's a great solution to run multiple tools in one process, and it provides a ready-to-use plugin for GitHub Actions.
To enable it, you have to create a config file .pre-commit-config.yaml in your repo root; the simplest with just blue looks like that:
repos:
- repo: https://github.com/grantjenks/blue
rev: v0.9.1
hooks:
- id: blue
My .github/workflows/pre-commit.yaml looks like this. pre-commit/action@v2.0.2 does the magic here:
I just migrated from
black
, and I'm using the same way as before -- pre-commit. It's a great solution to run multiple tools in one process, and it provides a ready-to-use plugin for GitHub Actions.To enable it, you have to create a config file
.pre-commit-config.yaml
in your repo root; the simplest with justblue
looks like that:My
.github/workflows/pre-commit.yaml
looks like this.pre-commit/action@v2.0.2
does the magic here:And remember that you can very easily run pre-commit locally, hence the name -- it can run all checks AKA hooks before each commit