oct.hooks.oct_hooks module#

Purpose#

Generate pre-commit hook configuration for Option C projects.

Responsibilities#

  • Generate a .pre-commit-config.yaml with oct lint --profile strict as a pre-commit hook.

  • Support --force to overwrite existing configuration.

Diagnostics#

Domain: OCT-HOOKS Levels:

L2 — lifecycle L3 — semantic details L4 — deep tracing

Contracts#

  • Must not overwrite existing .pre-commit-config.yaml without --force.

  • Generated configuration must be valid YAML.

Dependencies#

oct.hooks.oct_hooks.install_hooks(root: Path, force: bool = False) int[source]#

Generate .pre-commit-config.yaml in the project root.

Returns exit code: 0 on success, 1 on failure.