Skip to content

Commit d4b5ae9

Browse files
authored
Introduce pre-commit configuration (#280)
* Introduce pre-commit configuration * Add docs
1 parent 4b4a278 commit d4b5ae9

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

.pre-commit-config.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
repos:
2+
# Mirrors CI: poe lint → `ruff format --check` + `ruff check .`
3+
- repo: https://github.com/astral-sh/ruff-pre-commit
4+
rev: v0.15.13
5+
hooks:
6+
- id: ruff
7+
exclude: ^bin/
8+
- id: ruff-format
9+
exclude: ^bin/
10+

DEVELOP.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,19 @@ Format code:
3232

3333
poe format
3434

35+
## Pre-commit hooks
36+
37+
The repository ships a `.pre-commit-config.yaml` that runs the same linters
38+
as CI (`ruff check` + `ruff format --check`) on every commit. To install:
39+
40+
pip install pre-commit
41+
pre-commit install
42+
43+
After that, linting runs automatically before each `git commit`. To run it
44+
manually across all files:
45+
46+
pre-commit run --all-files
47+
3548

3649
## Preparing a release
3750

0 commit comments

Comments
 (0)