-
Notifications
You must be signed in to change notification settings - Fork 825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: use @commitlint/cz-commitlint instead of cz-conventional-changelog #7264
Conversation
Thank you for the contribution. I've personally been bitten by this before. That said, I think I'd personally rather not merge this due to the interactive wizard that it introduces. Furthermore, I think we can avoid the issue completely by not adding a scope in the commit message. Lerna is smart enough to figure out which module(s) changed when generating the changelog. Is there anyone from @aws-amplify/amplify-cli with strong feelings one way or the other here? |
I’m not sure that cz-conventional-changelog offers a way to prevent asking for the scope. Additionally, having the scope in the commit message is useful for humans scrolling back through the repo history (beyond the changelog generation).
The version of cz-conventional-changelog currently being used also has a bug where it incorrectly enforces the combined character count of your commit type + scope + summary. It can cause commits to seem like they’re within the character limit, but once submitted and commitlint takes over, it fails as the top line is too long. Since `@commitlint/cz-commitlint` is vended from commitlint directly, it is able to share the logic and doesn't fall prey to bugs of that nature.
|
Closing, as we discussed this during the meeting. We would like to make the committing process simpler and add validation around squashing if possible. |
reopening - I think there was a misunderstanding that this wizard would remove the ability to author messages using |
@johnpc and I discussed this on Slack. I'm OK with the changes to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with the merge conflicts resolved.
…elog This commit updates to @commitlint/cz-commitlint, which adds the `scope` enum from commitlint without changing the interactive commit experience. Further motivation is explained in conventional-changelog/commitlint#2547
…elog (aws-amplify#7264) This commit updates to @commitlint/cz-commitlint, which adds the `scope` enum from commitlint without changing the interactive commit experience. Further motivation is explained in conventional-changelog/commitlint#2547 Co-authored-by: John Corser <xss@amazon.com>
Description of changes
This pull request is a proposal that can be either taken or left. I got confused when I used
yarn commit
but no indication of validscopes
was provided during that potion of interaction. This resulted in me using an invalid scope, failing the commit, and re-runningyarn commit
with a valid scope from the failure error message.A lerna
scopes
enum (from@commitlint/config-lerna-scopes
) is currently enforced by commitlint. However,commitizen
is not configured to be aware of that list of valid scopes. This makes it possible to callyarn commit
and result in the generated commit failing the lint rule:This pull request removes the dependency on
cz-conventional-changelog
and installs@commitlint/cz-commitlint
as an alternative.@commitlint/cz-commitlint
shares it's config withcommitlint.config.js
, which gives it access to@commitlint/config-lerna-scopes
as selectable scopes without changing the interactive commit experience.Further motivation is explained in conventional-changelog/commitlint#2547
The downside of this change is that the scope of the change must be selected via arrow key-ing down to the scope you want. It might be faster for regular contributors to manually type their scope than scroll potentially very far down the list to find the desired scope.
If the current mechanism is preferred, feel free to close this PR. If the change is deemed valuable, let me know if anything else is needed to get it shipped.
Description of how you validated changes
I committed this very change on my fork in order to create this pull request
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.