Migrate pre-commit hooks from pre-commit to prek
Replace the Python-based pre-commit framework with prek (Rust) for faster hook execution. Convert .pre-commit-config.yaml to prek.toml, remove pre-commit from dev dependencies, and apply ruff auto-fixes (UP037: remove unnecessary string quotes in type annotations). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
47
prek.toml
Normal file
47
prek.toml
Normal file
@@ -0,0 +1,47 @@
|
||||
# Configuration file for `prek`, a git hook framework written in Rust.
|
||||
# See https://prek.j178.dev for more information.
|
||||
#:schema https://www.schemastore.org/prek.json
|
||||
|
||||
[[repos]]
|
||||
repo = "https://github.com/astral-sh/ruff-pre-commit"
|
||||
rev = "v0.15.0"
|
||||
hooks = [
|
||||
{
|
||||
id = "ruff",
|
||||
args = ["--fix"],
|
||||
files = "^backend/"
|
||||
},
|
||||
{
|
||||
id = "ruff-format",
|
||||
files = "^backend/"
|
||||
}
|
||||
]
|
||||
|
||||
[[repos]]
|
||||
repo = "local"
|
||||
hooks = [
|
||||
{
|
||||
id = "oxlint",
|
||||
name = "oxlint",
|
||||
entry = "npx oxlint -c frontend/.oxlintrc.json",
|
||||
language = "system",
|
||||
files = '^frontend/src/.*\.(ts|tsx)$',
|
||||
pass_filenames = true
|
||||
},
|
||||
{
|
||||
id = "oxfmt",
|
||||
name = "oxfmt",
|
||||
entry = "npx oxfmt --check --config frontend/.oxfmtrc.json",
|
||||
language = "system",
|
||||
files = '^frontend/src/.*\.(ts|tsx)$',
|
||||
pass_filenames = true
|
||||
},
|
||||
{
|
||||
id = "tsc",
|
||||
name = "tsc",
|
||||
entry = "bash -c 'cd frontend && npx tsc -b'",
|
||||
language = "system",
|
||||
files = '^frontend/src/.*\.(ts|tsx)$',
|
||||
pass_filenames = false
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user