hookcmd

package
v0.0.0-...-a02776c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package hookcmd implements the `fendix hook …` cobra subcommand tree (90-day cut, item 2). It installs a git pre-commit hook that runs a fast, staged, diff-aware scan on every commit — the second half of the "runs on every commit" developer-workflow story, after `fendix scan --diff --staged` (item 1).

fendix hook install     — write .git/hooks/pre-commit
fendix hook uninstall    — remove the fendix-managed hook
fendix hook status       — report whether the hook is installed

The installed hook runs:

fendix scan --code . --staged --fast --fail-on <severity>

--staged scopes the scan to the index and --fast skips Semgrep and native dependency scanners. Known product defect: because --code auto-enables the Python phase, the generated command is not currently native-only and can run the Python deps check. A finding at or above --fail-on aborts the commit only when the decision policy stamps it BLOCK; the developer fixes it (or bypasses with `git commit --no-verify`).

Safety: install refuses to clobber a pre-existing non-fendix pre-commit hook unless --force is passed, and never silently overwrites the user's own automation. The hook is marked with a sentinel comment so status / uninstall can recognise it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCmd

func NewCmd() *cobra.Command

NewCmd builds the `fendix hook` subcommand tree.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL