Skip to content

Commit 99386c1

Browse files
committed
Add pre-commit hooks for linting/formatting/typing
1 parent 7644a51 commit 99386c1

File tree

3 files changed

+154
-4
lines changed

3 files changed

+154
-4
lines changed

.pre-commit-config.yaml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
repos:
2+
- repo: https://github.com/pdm-project/pdm
3+
rev: 2.22.3
4+
hooks:
5+
- id: pdm-lock-check
6+
name: check lock file matches pyproject
7+
- repo: https://github.com/astral-sh/ruff-pre-commit
8+
rev: v0.9.4
9+
hooks:
10+
- id: ruff
11+
name: run the linter
12+
args: [ --fix ]
13+
- id: ruff-format
14+
name: run the formatter
15+
- repo: https://github.com/pre-commit/mirrors-mypy
16+
rev: v1.14.1
17+
hooks:
18+
- id: mypy
19+
name: run static type check
20+
args: [--strict, --ignore-missing-imports]

pdm.lock

+129-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+5-3
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,11 @@ readme = "README.md"
1111
license = {text = "Apache-2.0"}
1212

1313

14-
[tool.pdm]
15-
distribution = true
16-
1714
[dependency-groups]
1815
dev = [
1916
"mypy>=1.14.1",
2017
"ruff>=0.9.4",
18+
"pre-commit>=4.1.0",
2119
]
2220

2321
[tool.ruff]
@@ -63,3 +61,7 @@ docstring-code-format = false
6361
# This only has an effect when the `docstring-code-format` setting is
6462
# enabled.
6563
docstring-code-line-length = "dynamic"
64+
65+
[tool.pdm]
66+
distribution = true
67+

0 commit comments

Comments
 (0)