Add pre-commit configuration (#2451)

This commit is contained in:
Aarni Koskela
2024-02-26 21:05:24 +02:00
committed by GitHub
parent 46ac6c9bba
commit 67e698cf4d
2 changed files with 21 additions and 0 deletions

13
.pre-commit-config.yaml Normal file
View File

@ -0,0 +1,13 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.1
hooks:
- id: ruff
args:
- --fix
- id: ruff-format
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-merge-conflict
- id: check-yaml

View File

@ -172,6 +172,14 @@ Follow these steps to start contributing:
$ make quality $ make quality
``` ```
You can also set up [`pre-commit`](https://pre-commit.com/) to run these checks
automatically as Git commit hooks.
```bash
$ pip install pre-commit
$ pre-commit install
```
Once you're happy with your changes, add changed files using `git add` and Once you're happy with your changes, add changed files using `git add` and
make a commit with `git commit` to record your changes locally: make a commit with `git commit` to record your changes locally: