Skip to content
Arxo Arxo

Pre-commit Hooks

Run architecture analysis before each commit to catch violations early.

Create .git/hooks/pre-commit:

#!/bin/bash
echo "Running architecture analysis..."
if ! arxo analyze --quiet; then
echo "❌ Architecture violations detected!"
echo "Run: arxo analyze"
exit 1
fi
echo "✅ Architecture check passed"

Make it executable:

Terminal window
chmod +x .git/hooks/pre-commit

Create .pre-commit-config.yaml:

repos:
- repo: local
hooks:
- id: arxo
name: Architecture Analysis
entry: arxo analyze
language: system
pass_filenames: false
always_run: true

Install:

Terminal window
pip install pre-commit
pre-commit install