-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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 changelog item generation #8945
Conversation
Oh, right, I forgot to copy it over from You changes are great. How about moving your spec to |
@@ -51,7 +51,7 @@ def last_commit_title | |||
end | |||
|
|||
def extract_id(body) | |||
/^\[Fixes #(\d+)\] (.*)/.match(body)&.captures || [nil, body] | |||
/^\[Fix(?:es)? #(\d+)\] (.*)/.match(body)&.captures || [nil, body] |
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.
Cool, didn't know we could write either 😅
- Properly handle issues referring to other rubocop-hq repos - Only evaluate links at the beginning of a changelog item - Ensure that the link reference is valid (eg. not [#x] or []) - Ensure that a changelog item does not contain [Fix(es) #...] - Fixed improper CHANGELOG.md item
1bed908
to
4cd1337
Compare
@marcandre updated, merged my spec into yours, thanks! |
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.
Good job 💪 ! Thanks 😄
Re #8930. I found a couple issues when using
rake changelog:fix
to write a changelog item for another PR. Foremost,[Fix #xxxx]
as requested in the contributing guidelines was not being parsed properly (it was only looking forFixes
, now it accepts both).tasks/changelog.rb
did not have a spec, so I added a basic one that just covers this issue but is not exhaustive.I also updated the tests in
project_spec.rb
:[Fix #xxxx]
in it.[#x]
as invalid in a changelog itemThe last item is potentially contentious because the rake task prefaces items with
* [#x](https://github.com/rubocop-hq/rubocop/pull/x):
if a ref ID cannot be found, which will then causebundle exec rake default
to fail. This is kind of a paradox if there isn't already an issue to refer to (ie. sometimes in practice the link is to the PR that merges the change, which doesn't exist beforerake default
is run), so I'm not 100% sure about this, but I think the test is valuable in general to ensure we don't end up with[#x]
in the changelog./cc @marcandre
Before submitting the PR make sure the following are checked:
[Fix #issue-number]
(if the related issue exists).master
(if not - rebase it).bundle exec rake default
. It executes all tests and RuboCop for itself, and generates the documentation.