Commit Message ConventionsΒΆ
TorchEBM follows a specific format for commit messages to maintain a clear project history and generate meaningful changelogs. This document outlines the conventions that all contributors should follow when making commits to the project.
FormatΒΆ
Each commit message should have a specific format:
- The first line should be a maximum of 50-60 characters
- It should begin with an emoji followed by a type, then a colon and a brief description
- Any further details should be in the subsequent lines, separated by an empty line
Types and EmojisΒΆ
We use the following types and emojis to categorize commits:
Type | Emoji | Description |
---|---|---|
feat | β¨ | Introduces a new feature |
fix | π | Patches a bug in the codebase |
docs | π | Changes related to documentation |
style | π | Changes that do not affect the meaning of the code (formatting) |
refactor | π¦ | Code changes that neither fix a bug nor add a feature |
perf | π | Improvements to performance |
test | π¨ | Adding or correcting tests |
build | π· | Changes affecting the build system or external dependencies |
ci | π» | Changes to Continuous Integration configuration |
chore | π« | Miscellaneous changes that don't modify source or test files |
revert | π | Reverts a previous commit |
ExamplesΒΆ
Version Bumping and ReleasingΒΆ
For Maintainers
Version bumping and release tags are primarily for project maintainers. As a contributor, you don't need to worry about these when submitting pull requests. Project maintainers will handle versioning and releases.
For project maintainers, our CI/CD workflow supports the following tags:
- Use
#major
for breaking changes requiring a major version bump (e.g., 1.0.0 to 2.0.0) - Use
#minor
for new features requiring a minor version bump (e.g., 1.0.0 to 1.1.0) - Default is patch level for bug fixes (e.g., 1.0.0 to 1.0.1)
- Include
#release
to trigger a release to PyPI
Example (for maintainers):
Best PracticesΒΆ
- Be descriptive but concise in your commit message
- Focus on the why, not just the what
- Use present tense ("add feature" not "added feature")
- Separate commits logically - one commit per logical change
- Reference issues in commit messages when appropriate (e.g., "Fixes #123")
Following these conventions helps maintain a clean project history and facilitates automated changelog generation.