Skip to content

feat: add commit message standardization (#36)#41

Merged
c-vigo merged 10 commits intofeature/37-automate-standardize-repository-setupfrom
feature/36-standardize-commit-messages
Feb 2, 2026
Merged

feat: add commit message standardization (#36)#41
c-vigo merged 10 commits intofeature/37-automate-standardize-repository-setupfrom
feature/36-standardize-commit-messages

Conversation

@c-vigo
Copy link
Contributor

@c-vigo c-vigo commented Feb 2, 2026

Pull Request

Description

This PR merges commit message standardization (#36) into the automate-repository-setup branch (#37). It adds a documented commit message format, validation (Python script + commit-msg hook), Cursor integration, and workspace template updates so new repos get the same standard.

Related Issue(s)

Closes #36
Related to #37

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Test updates

Changes Made

  • Commit message standarddocs/COMMIT_MESSAGE_STANDARD.md and workspace copy: format type(scope)!: subject, mandatory Refs: #<issue>, approved types, traceability (REQ-/RISK-/SOP-).
  • Validationscripts/validate_commit_msg.py: validates subject, blank line, single Refs line with at least one #issue; used by commit-msg hook and tests.
  • Commit-msg hook.githooks/commit-msg (repo and assets/workspace/.githooks/commit-msg): runs validation; workspace hook checks IN_CONTAINER and calls validator.
  • Pre-commit — commit-msg stage in .pre-commit-config.yaml (repo) and workspace pre-commit config: validate-commit-msg hook.
  • Initscripts/init.sh: sets core.hooksPath .githooks, chmod +x for pre-commit and commit-msg, and commit.template .gitmessage.
  • Template.gitmessage (repo and workspace): subject + Refs placeholder.
  • Cursor.cursor/rules/commit-messages.mdc, .cursor/commands/commit-msg.md (repo and workspace): rules and slash command for commit workflow.
  • Workspaceassets/workspace/.devcontainer/scripts/setup-git-conf.sh: sets commit.template when .gitmessage exists.
  • Teststests/test_validate_commit_msg.py: valid/invalid messages; integration tests for commit-msg hook in workspace.
  • Docs — README/CONTRIBUTE: test-validate-commit-msg, commit standard reference.

Testing

  • Tests pass locally (just test)
  • Manual testing performed (describe below)

Manual Testing Details

  • just test-validate-commit-msg passes.
  • Commit with invalid message (e.g. git commit -m "invalid") is rejected by commit-msg hook.
  • Commit with valid message (e.g. feat: add x + blank line + Refs: #36) is accepted.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly (README.md, CONTRIBUTE.md, etc.)
  • I have updated the CHANGELOG.md in the [Unreleased] section
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Additional Notes

  • Base branch: feature/37-automate-standardize-repository-setup
  • No reviewer requested; remove assignees if added by default.

c-vigo added 10 commits February 2, 2026 10:41
- Introduced a comprehensive document outlining the commit message format for the repository.
- Defined structure, approved types, and compliance requirements to ensure consistency and traceability.
- Included guidelines for enforcing the standard in development environments and CI.

Refs: #36
- Introduced a new script to validate commit messages against the project's standard.
- Added a corresponding test suite to ensure the validation logic works correctly.
- Added test recipe to justfile
- Updated documentation to include the new validation command in the available recipes.

Refs: #36
- Modified init.sh to Install git template locally during project setup

Refs: #36
- Introduced a detailed guide for the Git commit workflow, outlining steps for analyzing staged changes and writing accurate commit messages.
- Added rules for commit message formatting, including mandatory structure and compliance requirements to ensure consistency.

Refs: #36
- Introduced a new commit-msg hook script to enforce commit message standards when committing within the development container.
- Updated init.sh to ensure the new hook is executable during setup.

Refs: #36
- Updated the validation script to require that GitHub issue references in commit messages use the '#' symbol (e.g., #36).
- Added a test case to ensure that commit messages without the hashtag in the Refs line are correctly identified as invalid.

Refs: #36
- Updated commit message guidelines to eliminate the requirement for a trailing newline at the end of the message.
- Adjusted validation logic and corresponding tests to reflect this change, ensuring commit messages can be valid without a trailing newline.

Refs: #36
- Added a new hook to validate commit messages during the commit-msg stage, ensuring adherence to the project's standards.
- The hook executes a Python script to perform the validation.

Refs: #36
@c-vigo c-vigo self-assigned this Feb 2, 2026
@c-vigo c-vigo added the feature New feature or request label Feb 2, 2026
@c-vigo c-vigo merged commit caf172d into feature/37-automate-standardize-repository-setup Feb 2, 2026
1 check passed
@c-vigo c-vigo deleted the feature/36-standardize-commit-messages branch February 2, 2026 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant