-
-
Notifications
You must be signed in to change notification settings - Fork 846
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
Bugfix: undefined method line_labels_for #753
Bugfix: undefined method line_labels_for #753
Conversation
@ferrarimarco ping |
Thanks for this PR! Can you please add a test case for this as well? |
ping, any update on this? |
@ferrarimarco ping |
@olleolleolle can you have a look at this as well? Thanks! |
@@ -7,7 +7,7 @@ module GitHubChangelogGenerator | |||
# | |||
# @see GitHubChangelogGenerator::Entry | |||
class Section | |||
attr_accessor :name, :prefix, :issues, :labels, :body_only | |||
attr_accessor :name, :options, :prefix, :issues, :labels, :body_only |
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.
If we're not using the setter, can :options
become a attr_reader
?
@@ -49,7 +49,7 @@ def get_string_for_issue(issue) | |||
encapsulated_title = encapsulate_string issue["title"] | |||
|
|||
title_with_number = "#{encapsulated_title} [\\##{issue['number']}](#{issue['html_url']})" | |||
title_with_number = "#{title_with_number}#{line_labels_for(issue)}" if @options[:issue_line_labels].present? | |||
title_with_number = "#{title_with_number}#{Entry.new(options).line_labels_for(issue)}" if @options[:issue_line_labels].present? |
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.
Perhaps later, one can build an @entry
to be used to repeatedly make the line_labels_for
call on?
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 fixes the bug, gets the behavior we want.
In order not to repeat the Entry.new(options)
and to not create an Section#options=
setter that we don't need, we'll need to return to this code.
@dusan-dragon Thanks for adding this. 🎉
@ferrarimarco So, one way to deal with the code notes that I mentioned in my ✅ passing review is that we make them, when this has landed in master. |
If you specify option
issue-line-labels
in your.github_changelog_generator
it will throw:This is fix for it.