Skip to content

Commit

Permalink
feat(commit): enhance commitlint configuration
Browse files Browse the repository at this point in the history
Improved commitlint configuration with better documentation and additional rules
- Added detailed comments for each commit type
- Added new rules for body and footer formatting
- Improved overall code documentation
  • Loading branch information
ichoosetoaccept committed Dec 14, 2024
1 parent ba61b4c commit c5390bd
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 17 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ This project uses Calendar Versioning (YYYY.MM.MINOR).
- GitHub workflow to update changelog on PR merges
- Switched to Calendar Versioning
- Added GitHub Actions status badge to README.md
- Enhanced commitlint configuration with better documentation and additional rules:
- Added detailed comments for each commit type
- Added new rules for body and footer formatting
- Improved overall code documentation

## [2024.12.2] - 2024-12-14

Expand Down
41 changes: 24 additions & 17 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,35 @@
/**
* Commitlint configuration for enforcing Angular commit convention
* See: https://github.com/conventional-changelog/commitlint
*/
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'type-enum': [
2,
'always',
[
'feat', // New feature
'fix', // Bug fix
'docs', // Documentation only changes
'style', // Changes that do not affect the meaning of the code
'refactor',// A code change that neither fixes a bug nor adds a feature
'perf', // A code change that improves performance
'test', // Adding missing tests or correcting existing tests
'build', // Changes that affect the build system or external dependencies
'ci', // Changes to our CI configuration files and scripts
'chore', // Other changes that don't modify src or test files
'revert', // Reverts a previous commit
'feat', // New feature for the user
'fix', // Bug fix for the user
'docs', // Documentation only changes
'style', // Changes that do not affect the meaning of the code (white-space, formatting, etc)
'refactor', // A code change that neither fixes a bug nor adds a feature
'perf', // A code change that improves performance
'test', // Adding missing tests or correcting existing tests
'build', // Changes that affect the build system or external dependencies
'ci', // Changes to our CI configuration files and scripts
'chore', // Other changes that don't modify src or test files
'revert', // Reverts a previous commit
],
],
'type-case': [2, 'always', 'lower'],
'type-empty': [2, 'never'],
'scope-case': [2, 'always', 'lower'],
'subject-empty': [2, 'never'],
'subject-full-stop': [2, 'never', '.'],
'header-max-length': [2, 'always', 72],
'type-case': [2, 'always', 'lowerCase'], // Type must be lowercase
'type-empty': [2, 'never'], // Type cannot be empty
'scope-case': [2, 'always', 'lowerCase'], // Scope must be lowercase
'subject-empty': [2, 'never'], // Subject cannot be empty
'subject-full-stop': [2, 'never', '.'], // Subject cannot end with period
'header-max-length': [2, 'always', 72], // Header has a maximum length
'body-leading-blank': [2, 'always'], // Body should have leading blank line
'footer-leading-blank': [1, 'always'], // Footer should have leading blank line
'body-max-line-length': [2, 'always', 100], // Body lines should not exceed 100 chars
},
};

0 comments on commit c5390bd

Please sign in to comment.