Git Commit Hooks
Git Commit Hooks
Active
Keep repository checks active when Custy runs locally or inside a different operating-system container.
Command
[tool.custy.git.hooks]Category
Git Configuration
Quick Command
[tool.custy.git.hooks]Configurationâ
Properties
| Property | Type | Description | Default | Required |
|---|---|---|---|---|
mode | auto | native | pre_commit | Select native Git execution or verified direct pre-commit execution. | auto | No |
Recommended default
toml[tool.custy.git.hooks]
mode = "auto"Behavior Matrix
Hook Resolution
| auto + no installed hook | Use normal Git commit behavior. pre-commit is not required or activated. |
|---|---|
| auto + compatible hook | Let Git execute the installed hook natively. |
| auto + incompatible pre-commit wrapper | Run the recognized configured pre-commit stage directly, then skip only that already-completed wrapper for the current commit. |
| auto + incompatible custom hook | Stop safely because Custy cannot prove an equivalent execution path. |
| native | Always let Git execute installed hooks exactly as stored in the repository. |
| pre_commit | Require .pre-commit-config.yaml and the pre-commit executable, run configured stages directly, and continue only after they pass. |
Local and Docker Guidance
- Keep
mode = "auto"for most projects, including projects that do not use pre-commit. - Use
nativewhen custom hooks are already portable across every execution environment. - Use
pre_commitwhen project policy requires direct framework execution. - Install local support with
pip install "custy[hooks]". The production image already containspre-commit. - A failing direct check returns
PRE_COMMIT_HOOK_FAILEDand does not create a Git commit.