Skip to content

Commit

Permalink
dev: migrate pre-commit to lefthook (#223)
Browse files Browse the repository at this point in the history
  • Loading branch information
disrupted authored Dec 20, 2024
1 parent d41a6f8 commit a02c508
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 189 deletions.
35 changes: 0 additions & 35 deletions .github/workflows/pre-commit-auto-update.yml

This file was deleted.

30 changes: 30 additions & 0 deletions .lefthook.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
pre-commit:
parallel: true
commands:
lock:
glob: "{pyproject.toml,uv.lock}"
run: uv lock --check
lint:
glob: "*.py"
run: uv run ruff check --fix {staged_files}
stage_fixed: true
fmt:
glob: "*.py"
run: uv run ruff format {staged_files}
stage_fixed: true
pyright:
glob: "*.py"
run: uv run pyright

post-checkout:
commands:
dependencies:
glob: uv.lock
run: uv sync

post-merge:
files: "git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD"
commands:
dependencies:
glob: uv.lock
run: uv sync
47 changes: 0 additions & 47 deletions .pre-commit-config.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ dev = [
"pytest-httpx>=0.35.0",
"ruff>=0.8.3",
"pyright[nodejs]>=1.1.390",
"pre-commit>=4.0.1",
"freezegun>=1.5.1",
"virtualenv>=20.28.0", # HACK: fix pre-commit: ModuleNotFoundError: No module named 'distutils'
]

[tool.ruff]
Expand Down
105 changes: 0 additions & 105 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a02c508

Please sign in to comment.