git_hooks_install: Install Git Pre-commit Hook

View source: R/git_hooks.R

git_hooks_installR Documentation

Install Git Pre-commit Hook

Description

Creates a pre-commit hook that runs Framework checks based on settings.yml settings.

Usage

git_hooks_install(config_file = NULL, force = FALSE, verbose = TRUE)

Arguments

config_file

Path to configuration file (default: "settings.yml")

force

Logical; if TRUE, overwrite existing hook (default: FALSE)

verbose

Logical; if TRUE (default), show installation messages

Details

Creates or updates .git/hooks/pre-commit to run enabled Framework hooks:

  • ai_sync: Sync AI assistant context files before commit

  • data_security: Run security audit to catch data leaks

  • check_sensitive_dirs: Warn about unignored sensitive directories

Hook behavior is controlled by ⁠git.hooks.*⁠ settings in settings.yml.

Value

Invisible TRUE on success, FALSE on failure

Examples


if (FALSE) {
# Install hooks based on settings.yml
git_hooks_install()

# Force reinstall (overwrites existing hook)
git_hooks_install(force = TRUE)
}



framework documentation built on Feb. 18, 2026, 1:07 a.m.