Skip to content

Commit fb359b8

Browse files
ChangingSelfclaude
andcommitted
chore: 添加 pre-commit hook 配置
- 添加 .pre-commit-config.yaml 配置文件 - 添加 pre-commit 到 dev 依赖组 - 配置 ruff --fix 和 ruff-format 在提交前自动运行 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 27d9c56 commit fb359b8

3 files changed

Lines changed: 80 additions & 0 deletions

File tree

.pre-commit-config.yaml

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

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,5 +140,10 @@ python_functions = ["test_*"]
140140
requires = ["hatchling"]
141141
build-backend = "hatchling.build"
142142

143+
[dependency-groups]
144+
dev = [
145+
"pre-commit>=4.5.1",
146+
]
147+
143148
[tool.hatch.build.targets.wheel]
144149
packages = ["src"]

uv.lock

Lines changed: 68 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)