Skip to content

Latest commit

 

History

History
33 lines (22 loc) · 865 Bytes

File metadata and controls

33 lines (22 loc) · 865 Bytes

Git Hooks

This directory contains git hooks for the repository.

Setup

To enable the git hooks, run:

python3 .githooks/setup.py

Or on Windows:

python .githooks\setup.py

This configures git to use hooks from this directory instead of the default .git/hooks.

Note: The hooks are written in Python for cross-platform compatibility (Linux, macOS, Windows).

Available Hooks

pre-commit

Automatically updates copyright years in files being committed. The hook:

  • Runs scripts/update_copyright.py on modified files
  • Updates copyright year ranges (e.g., 2019-2024 → 2019-2025)
  • Adds single years where missing (e.g., 2019 → 2019-2025)
  • Automatically stages the copyright changes
  • Works across Linux, macOS, and Windows

The hook only modifies files already staged for commit and will not cause the commit to fail.