Skip to content

Commit 3496335

Browse files
dhellmannclaude
andcommitted
feat: integrate hatch lint and mypy checks into pre-commit hooks
Add local hooks to run hatch lint:check and mypy:check as part of pre-commit workflow, ensuring comprehensive code quality checks before commits. Add separate 'precommit' hatch script to manually run pre-commit hooks without circular dependency. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent e1b4c62 commit 3496335

3 files changed

Lines changed: 18 additions & 2 deletions

File tree

.github/workflows/check.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
run: python -m pip install hatch 'click!=8.3.0'
2525

2626
- name: Run pre-commit hooks
27-
run: hatch run lint:install-hooks && hatch run lint:check
27+
run: hatch run lint:install-hooks && hatch run lint:precommit
2828

2929
linter:
3030
name: linter

.pre-commit-config.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,19 @@ repos:
88
- id: check-yaml # Validates YAML syntax
99
- id: check-merge-conflict # Prevents merge conflict markers
1010
- id: check-toml # Validates TOML syntax
11+
12+
- repo: local
13+
hooks:
14+
- id: hatch-lint
15+
name: hatch lint check
16+
entry: hatch run lint:check
17+
language: system
18+
types: [python]
19+
pass_filenames: false
20+
21+
- id: hatch-mypy
22+
name: hatch mypy check
23+
entry: hatch run mypy:check
24+
language: system
25+
types: [python]
26+
pass_filenames: false

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,12 +244,12 @@ check = [
244244
"ruff check src tests",
245245
"ruff format --check src tests",
246246
"python ./e2e/mergify_lint.py",
247-
"pre-commit run --all-files",
248247
]
249248
fix = [
250249
"ruff format src tests docs",
251250
"ruff check --fix src tests docs",
252251
]
252+
precommit = "pre-commit run --all-files"
253253
install-hooks = "pre-commit install"
254254
pkglint = [
255255
"python -m build",

0 commit comments

Comments
 (0)