Skip to content

Commit 47c4d95

Browse files
authored
Add pre-commit configuration (#1467)
1 parent 65513e5 commit 47c4d95

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

.pre-commit-config.yaml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
repos:
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
rev: v0.2.1
4+
hooks:
5+
- id: ruff
6+
args:
7+
- --fix
8+
- id: ruff-format
9+
- repo: https://github.com/pre-commit/pre-commit-hooks
10+
rev: v4.5.0
11+
hooks:
12+
- id: check-merge-conflict
13+
- id: check-yaml

docs/source/developer_guides/contributing.md

+8
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ make quality # just check
4141
make style # check and fix
4242
```
4343

44+
You can also set up [`pre-commit`](https://pre-commit.com/) to run these fixes
45+
automatically as Git commit hooks.
46+
47+
```bash
48+
$ pip install pre-commit
49+
$ pre-commit install
50+
```
51+
4452
Running all the tests can take a couple of minutes, so during development it can be more efficient to only run tests specific to your change:
4553

4654
```sh

0 commit comments

Comments
 (0)