# Hook: pre-commit-code-quality ## Trigger Runs before any commit that modifies files in `src/`. ## Purpose Enforces coding standards before code enters version control. Catches style violations, missing documentation, overly complex methods, and hardcoded values that should be data-driven. ## Implementation ```bash #!/bin/bash # Pre-commit hook: Code quality checks # Adapt the specific checks to your language and tooling CODE_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -E '^src/') EXIT_CODE=0 if [ -n "$CODE_FILES" ]; then for file in $CODE_FILES; do # Check for hardcoded magic numbers in gameplay code if [[ "$file" == src/gameplay/* ]]; then # Look for numeric literals that are likely balance values # Adjust the pattern for your language if grep -nP '(?