Skip to content

Commit

Permalink
Add pre-commit configuration (#1467)
Browse files Browse the repository at this point in the history
  • Loading branch information
akx authored Feb 19, 2024
1 parent 65513e5 commit 47c4d95
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions docs/source/developer_guides/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ make quality # just check
make style # check and fix
```

You can also set up [`pre-commit`](https://pre-commit.com/) to run these fixes
automatically as Git commit hooks.

```bash
$ pip install pre-commit
$ pre-commit install
```

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:

```sh
Expand Down

0 comments on commit 47c4d95

Please sign in to comment.