Skip to main content

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]

safe defaultspre-commitcontainers

Configuration​

Properties

PropertyTypeDescriptionDefaultRequired
modeauto | native | pre_commitSelect native Git execution or verified direct pre-commit execution.autoNo
Recommended default
toml
[tool.custy.git.hooks]
mode = "auto"

Behavior Matrix

Hook Resolution

auto + no installed hookUse normal Git commit behavior. pre-commit is not required or activated.
auto + compatible hookLet Git execute the installed hook natively.
auto + incompatible pre-commit wrapperRun the recognized configured pre-commit stage directly, then skip only that already-completed wrapper for the current commit.
auto + incompatible custom hookStop safely because Custy cannot prove an equivalent execution path.
nativeAlways let Git execute installed hooks exactly as stored in the repository.
pre_commitRequire .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 native when custom hooks are already portable across every execution environment.
  • Use pre_commit when project policy requires direct framework execution.
  • Install local support with pip install "custy[hooks]". The production image already contains pre-commit.
  • A failing direct check returns PRE_COMMIT_HOOK_FAILED and does not create a Git commit.

Continue