Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
fix: lowercase first word of commit message #12440
fix: lowercase first word of commit message #12440
Changes from 4 commits
fef5521
178b183
d94827e
2f21e7e
5a00e52
c43c5e6
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
I'm not sure this is accurate enough
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.
I think this should be done in commit message builder.
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.
This snippet works fine for the all the cases except
Really great feature: Foo
, for this type of message it lowercases the whole string which is a problem. Isn't such a commit message valid, cause it violates the good-commit-message rules?Regarding the accuracy of the regex, we are only targeting the sub-string we want to lowercase
/.*: \w/
-> It will look for a semi-colon and a word after it (i.e first word of message)-Eg.
fix: Upgrade something
for this our match isfix: Upgrade
/^\w/
-> It matches first word of the message.-Eg.
Upgrade Something Please
-> It matchesUpgrade
.Also I was wondering what would be the updated commit message for
Really great feature: Foo
really great feature: Foo
or,really great feature: foo
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.
i still suggest to move the whole logic to this file:
https://github.com/renovatebot/renovate/blob/5af1b77f6919b554b3170c2465094a1442eb0221/lib/workers/repository/model/commit-message.ts#L1-L55
As we build the message there, so it should be more easily to fix it there for all
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.
@viceice I am not sure where the changes need to be updated in the new file, could you please guide me by commenting on the file where the certain functionalities needs to be added.
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.
@RahulGautamSingh I guess in general would be nice if
BranchUpgradeConfig
interface will have instance ofCommitMessage
class. Therefore need to refactorlib/workers/repository/updates/generate.ts
to using this class. During this refactoring maybe will be required extend functionality ofCommitMessage
or create inherited class for specific purposes.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.
Thanks for the help @pret-a-porter . Seems that I need to go through the code and refactor it. I am closing this PR for now and will create a new one when I have updated the code.
Hey @rarkins ,once you give the above suggestion by @pret-a-porter a 👍 I will start my work.