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
# Example: git hook configuration end to end.
#
# croft recognises hooks from two places, both run by the installed
# shim:
#
# 1. `[hooks.<stage>]` below — native croft hooks (recipe / script
# names).
# 2. `.pre-commit-config.yaml` at the project root — standard
# pre-commit-format file, parsed by croft directly.
#
# Run `croft hooks install` from this directory to wire up the
# shims (you'll need a git repo; `git init` first if needed).
[]
= "hooks-demo"
= "Native croft hooks plus pre-commit-config.yaml integration"
[]
= "none" # host-only
[]
= false # so this example can be run without
# affecting the host project's hooks
# ---- Recipes referenced by [hooks.pre-commit] below ----------
[]
= "Check formatting (no autofix)"
= "echo '[fmt] would run cargo fmt --check / prettier --check / etc.'"
[]
= "Run static analysis"
= "echo '[lint] would run cargo clippy / eslint / phpstan / etc.'"
# Aggregator. `croft check` runs both in order; first non-zero exit
# halts the chain.
[]
= "Format + lint, in that order"
= ["fmt", "lint"]
# ---- Native croft hooks ------------------------------------
[]
# Run on `git commit`. Recipe / script names from above (or
# discovered under .croft/commands/).
= ["check"]
# Run on `git push`. Empty list = no hook for that stage.
= []