enter_project.sh
Initializes the development environment by installing commit message linting and pre-commit hooks.
Purpose
Ensures developers follow consistent commit message standards and run automated checks before committing code. Installs and configures tools that are essential for maintaining code quality.
Tools Installed
- Commitizen - Enforces standardized commit messages (via
commitizenCLI) - Guides developers through interactive commit message creation
- Ensures messages follow conventional commit format
-
Installed via
pipxfor isolated Python environment -
Pre-commit - Automatically runs checks before commits
- Git hooks configured for automated validation
- Prevents committing code that fails linting, formatting, or tests
- Hooks configured:
pre-commit- Runs before commit creationcommit-msg- Validates commit message format
Usage
./scripts/enter_project.sh
This script idempotently checks if tools are installed and only installs if needed:
- If
commitizen(cz) is missing, it installspipxand thencommitizen - If pre-commit Git hooks are missing, it runs
pre-commit install
When to Run
- First time in the project - Run this to set up the development environment
- Safe to run multiple times - Script checks if tools exist before installing
What Gets Modified
~/.local/bin/- Addscommitizencommand (via pipx).git/hooks/pre-commit- Installs pre-commit hook.git/hooks/commit-msg- Installs commit message validation hook
Related Documentation
See .github/instructions/commitMessageGeneration.instructions.md for commit message standards.