Thanks to visit codestin.com
Credit goes to github.com

Skip to content

tools/verifygitlog.py: Fix error message for commit subject line. #6821

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

Closed

Conversation

titouanc
Copy link
Contributor

Fix https://github.com/micropython/micropython/runs/1801587962?check_suite_focus=true.

In this run, we see:

 error: commit a1a7285: Subject line should contain ': ' and end in '.': py/makeversionhdr: honor SOURCE_DATE_EPOCH if present.

However, the subject line "py/makeversionhdr: honor SOURCE_DATE_EPOCH if present." actually contains a ': ' and ends with a '.', which could be confusing.

Expand the error message to also mention that the subject should be a capitalized sentence.

@stinos
Copy link
Contributor

stinos commented Jan 31, 2021

How about "Subject line should contain ': ' followed by a capitalized verb, and end in '.': "? Shorter and more info. On the other hand: there are more rules than just these 3 so I think after this change the next person is going to show up and say it's confusing :) With reason; which is exactly why the link to the code conventions is there, to take away confusion. I.e. I'd say that either this should have the complete explanation including examples, or else should be left as-is.

@titouanc
Copy link
Contributor Author

there are more rules than just these 3 so I think after this change the next person is going to show up and say it's confusing

Yes indeed, I didn't consider describing the other cases as they did not bothered me.

I'd say that either this should have the complete explanation including examples, or else should be left as-is.

A third alternative could be Subject line doesn't match "^[^!]+: [A-Z]+.+ .+\.$": it's concise, and not misleading. The code convention link at the end of a failed run already provides the explanation and examples. I would also add to this document that the sentence has to be capitalized (that was not obvious to me)

@stinos
Copy link
Contributor

stinos commented Jan 31, 2021

Showing the regex is indeed a good idea imo. Still confusing if you don't know regex, but at least then you can use one of the many online regex websites to verify.

@dpgeorge dpgeorge added the tools Relates to tools/ directory in source, or other tooling label Jan 31, 2021
@dpgeorge
Copy link
Member

Yeah, probably a good idea to actually list the regex, so that we don't run into this problem again (error message emitted when you think you did everything correctly).

@stinos
Copy link
Contributor

stinos commented Feb 19, 2021

@titouanc if you have the time could you update this to show the regex? This keeps popping up :)

@titouanc titouanc force-pushed the fix-subject-line-warning branch 2 times, most recently from cacf4e4 to fdb1e2e Compare February 19, 2021 09:42
@titouanc titouanc force-pushed the fix-subject-line-warning branch from fdb1e2e to ff80cba Compare February 19, 2021 09:43
@titouanc
Copy link
Contributor Author

@stinos Thank you for the heads up.

I amended my commit, and rebased on top of master

@stinos
Copy link
Contributor

stinos commented Feb 19, 2021

Awesome, looks good.

@dpgeorge
Copy link
Member

Thanks! Merged in d334d78

@dpgeorge dpgeorge closed this Feb 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tools Relates to tools/ directory in source, or other tooling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants