-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlefthook.yml
More file actions
38 lines (38 loc) · 1.12 KB
/
lefthook.yml
File metadata and controls
38 lines (38 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
skip_output:
- meta
- success
- summary
pre-commit:
parallel: true
commands:
# Run ruff directly instead of through uv tool run.
# According to my test of `ruff --version` with hyperfine, this saves about 10 ms.
# Users don't have to enable this commit hook if they don't have ruff on their path.
black:
tags: formatter
glob: "*.{py,pyi}"
run: ruff format --check -- {staged_files}
isort:
tags: formatter
glob: "*.{py,pyi}"
run: ruff check --select 'I' --output-format 'concise' -- {staged_files}
taplo:
tags: formatter
glob: "*.toml"
# No need to --force-exclude for taplo
run: taplo format --check -- {staged_files}
env:
# without this, taplo is very verbose
RUST_LOG: warn
typos:
tags: spellcheck
run: typos --force-exclude -- {staged_files}
# takes one parameter - the file with the proposed commit message
# access through lefthook with `{1}`
#
# If this hook fails, a backup of the commit message is saved in .git/
commit-msg:
commands:
typos-commit:
tags: spellcheck
run: typos -- {1}