Skip to content

Commit 402b509

Browse files
committed
Set up pre-commit hooks
Use the `pre-commit` framework to manage pre-commit hooks; for now just run `ruff format` and `ruff check --fix`.`
1 parent 4a6ce7b commit 402b509

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

.pre-commit-config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
repos:
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
# Check https://github.com/astral-sh/ruff-pre-commit/releases for the latest version
4+
rev: v0.14.5
5+
hooks:
6+
- id: ruff-check
7+
args: [--fix]
8+
- id: ruff-format

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ Development setup (general)
8585
---------------------------
8686

8787
``` sh
88+
# Set up pre-commit hooks to check and format source code
89+
uv run pre-commit install
90+
8891
# TEST-DRIVEN WORKFLOW
8992

9093
# To run tests and check style

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ flatpak-indexer = "flatpak_indexer.cli:cli"
3838

3939
[dependency-groups]
4040
dev = [
41+
"pre-commit>=2.1.1",
4142
"ruff",
4243
]
4344

0 commit comments

Comments
 (0)