Expand description
Detect which pre-commit hook framework, if any, is wired into a project.
The detector is read-only: it inspects filesystem markers under the
project root and returns a PreCommitSystem enum value. It never
installs anything, modifies files, or contacts the network.
Detection order (deterministic; later checks only run if earlier checks did not match):
Prek—.pre-commit-config.yamlis present AND a prek-specific marker is present (prekresolvable onPATH, amise.tomlmentioningprek, or aprek:toolchain hint inside.pre-commit-config.yaml).PreCommit—.pre-commit-config.yamlexists but no prek marker is present.Husky—.husky/directory exists at the project root, ORpackage.jsoncontains a top-levelhuskykey.Lefthook— any oflefthook.{yml,yaml}or.lefthook.{yml,yaml}exists at the project root.None— no markers found.
Used by the ito init advisory for explicit downstream hook setup.
Enums§
- PreCommit
System - The pre-commit hook framework detected in a project.
Functions§
- detect_
pre_ commit_ system - Detect the pre-commit framework wired into the project at
project_root.