Closed KeisukeYamashita closed 2 weeks ago
[!CAUTION]
Review failed
The pull request is closed.
The changes introduce a new boolean field, optional
, to the Scope
struct, allowing for the absence of a scope when this field is set to true
. The validate
method has been adjusted to accommodate this new functionality. Additionally, the documentation for scopes has been updated to clarify the configuration options, including the new optional
attribute and its implications for commit messages.
File | Change Summary |
---|---|
src/rule/scope.rs | Added optional: bool field to Scope , updated default implementation, modified validate method, and added test cases for the new field. |
web/src/content/docs/rules/scope.md | Enhanced clarity of the document regarding configuration options, added a section for optional scopes, and corrected YAML formatting. |
Objective | Addressed | Explanation |
---|---|---|
Allow empty scope, but if scope exists must be listed in config (Issue #355) | ✅ |
🐰 In the fields of code, I hop with glee,
A newoptional
field, as bright as can be!
With scopes now flexible, oh what a delight,
Commit messages dance, both day and night!
So let’s code together, with joy and with cheer,
For every new feature, our vision is clear! 🌟
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Signed-off-by: KeisukeYamashita 19yamashita15@gmail.com# Why
Resolves: https://github.com/KeisukeYamashita/commitlint-rs/issues/355
In some cases, scope can be optional, but users may want to apply an allow list if a value is provided. Currently, the
scope-empty
andscope
are exclusive, and this policy can be configured.Summary by CodeRabbit
New Features
optional
attribute for scopes, allowing flexibility in commit messages.optional
field.Documentation
scope.md
document.