diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..1563cffd --- /dev/null +++ b/.pre-commit-config.yaml @@ -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 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 592252db..c8a1c425 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -172,6 +172,14 @@ Follow these steps to start contributing: $ 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 make a commit with `git commit` to record your changes locally: