-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlefthook.yaml
53 lines (51 loc) · 1.97 KB
/
lefthook.yaml
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# yaml-language-server: $schema=https://raw.githubusercontent.com/evilmartians/lefthook/master/schema.json
pre-commit:
parallel: true
commands:
uv-lock:
glob: "{pyproject.toml,uv.lock}"
run: uv lock --check
ruff-check:
glob: "*.py"
run: uv run ruff check --force-exclude --config pyproject.toml --fix --show-fixes {staged_files}
stage_fixed: true
ruff-format:
glob: "*.py"
run: uv run ruff format --force-exclude --config pyproject.toml {staged_files}
stage_fixed: true
pyright:
glob: "*.py"
run: uv run pyright
dprint:
glob: "*.{json,jsonc,yaml,yml,md,toml,css}"
run: dprint fmt
kpops-schema:
glob: "{uv.lock,kpops/**/*.py,hooks/gen_schema.py}"
run: python -m hooks.gen_schema && git add -u docs/docs/schema
kpops-docs-cli:
glob: "{uv.lock,kpops/cli/main.py,hooks/gen_docs/gen_docs_cli_usage.py}"
run: python -m hooks.gen_docs.gen_docs_cli_usage
kpops-docs-env-vars:
glob: "{uv.lock,kpops/**/*.py,hooks/gen_docs/gen_docs_env_vars.py}"
run: python -m hooks.gen_docs.gen_docs_env_vars
kpops-docs-components:
glob: "{\
.gitignore,\
uv.lock,\
hooks/gen_docs/gen_docs_components.py,\
docs/docs/resources/pipeline-defaults/headers/*.yaml,\
docs/docs/resources/pipeline-components/headers/*.yaml,\
docs/docs/resources/pipeline-components/sections/*.yaml,\
docs/docs/resources/pipeline-components/dependencies/*.yaml,\
kpops/components/*.py\
}"
# .gitignore -- indicates whether the script is ran with `--all-files`
# hooks/gen_docs/gen_docs_components.py -- hook's behavior is possibly changed
# docs/.../.yaml -- examples changed or dependencies edited
# kpops/components/... -- KPOps components possibly changed
run: python -m hooks.gen_docs.gen_docs_components {staged_files}
post-checkout:
commands:
dependencies:
glob: "uv.lock"
run: uv sync