Files
cimtechniques-service-suite/scripts/setup_hooks.py
Andy 63169a7644 feat: add versioning and changelog system
Conventional-Commit-driven version bumps (scripts/bump.py), a commit-msg validation hook, and a /release-notes workflow that produces a human-reviewed CHANGELOG.md. Adds an in-app version badge + 'What's new' dialog on the launcher. The version is single-sourced from pyproject.toml (cim_suite.__version__), and the deterministic bump backbone lives in scripts/release/ with tests in tests/release/. Marks the 1.0.0 baseline.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-06 11:31:22 -04:00

34 lines
918 B
Python

#!/usr/bin/env python
"""One-time install of the repo's git hooks on a fresh clone.
Points git at the version-controlled ``.githooks`` directory so the commit-msg
validator runs without copying anything into ``.git``.
python scripts/setup_hooks.py
"""
from __future__ import annotations
import os
import stat
import subprocess
from pathlib import Path
ROOT = Path(__file__).resolve().parent.parent
def main() -> int:
subprocess.run(["git", "config", "core.hooksPath", ".githooks"], cwd=ROOT, check=True)
hook = ROOT / ".githooks" / "commit-msg"
if hook.is_file() and os.name != "nt":
hook.chmod(hook.stat().st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
print("Git hooks installed: core.hooksPath -> .githooks")
print("Commit messages will now be validated against the Conventional Commit format.")
return 0
if __name__ == "__main__":
raise SystemExit(main())