Skip to content

Beta — Pre-commit hook for Conventional Commits with DevRail types and scopes

License

Notifications You must be signed in to change notification settings

devrail-dev/pre-commit-conventional-commits

Repository files navigation

pre-commit-conventional-commits

DevRail v1 is stable. See STABILITY.md for component status.

A pre-commit hook that enforces Conventional Commits with DevRail-specific types and scopes.

pre-commit License: MIT

Quick Start

  1. Add to your .pre-commit-config.yaml:
repos:
  - repo: https://github.com/devrail-dev/pre-commit-conventional-commits
    rev: v1.0.0
    hooks:
      - id: conventional-commits
  1. Install the hooks:
make install-hooks
  1. Commit with the correct format:
type(scope): description

Usage

Commit Format

type(scope): description

Valid Types

Type When to Use
feat A new feature or capability
fix A bug fix
docs Documentation-only changes
chore Maintenance tasks (dependencies, config)
ci CI/CD pipeline changes
refactor Code restructuring without behavior change
test Adding or updating tests

Valid Scopes

Scope Applies To
python Python tooling, configs, or standards
terraform Terraform tooling, configs, or standards
bash Bash tooling, configs, or standards
ansible Ansible tooling, configs, or standards
container Dev-toolchain container image
ci CI/CD pipeline configuration
makefile Makefile targets and patterns
standards DevRail standards documentation

Examples

feat(python): add ruff configuration for type checking
fix(ci): correct Docker image reference in build workflow
docs(standards): update .devrail.yml schema with container overrides
chore(makefile): update dev-toolchain image tag to v1.2.0
ci(container): add weekly rebuild schedule
refactor(bash): extract common logging to shared library
test(terraform): add terratest validation for module outputs

Rules

  • type is required and must be from the valid types list
  • scope is required and must be from the valid scopes list
  • Colon and space after the closing parenthesis are required
  • description must be non-empty and start with a lowercase letter
  • No period at the end of the description
  • Merge commits (Merge ...) and revert commits (Revert ...) are allowed

Configuration

This hook requires no configuration. Types and scopes are enforced globally per DevRail standards.

Contributing

See DEVELOPMENT.md for development setup and contribution guidelines.

To add a new language ecosystem to DevRail, see the Contributing to DevRail guide.

License

MIT

About

Beta — Pre-commit hook for Conventional Commits with DevRail types and scopes

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors