You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an access modifier has a comment on the same line and is not followed by an empty line, the autocorrection for Style/EmptyLinesAroundAccessModifier inserts the newline before the comment. I would expect it to insert the newline after the comment.
(I discovered this while working on #4127 because this bug broke the # rubocop:disable Lint/UselessAccessModifier my change added to a line. I'm working on a fix.)
Example
classExamplesomethingprivate# let's make the rest privatedefexample;endend
Expected correction
classExamplesomethingprivate# let's make the rest privatedefexample;endend
Actual correction
(one iteration)
classExamplesomethingprivate# let's make the rest privatedefexample;endend
…oundAccessModifier
Previously the autocorrect implementation inserted a newline at the end of the access modifier
_node_ instead of at the end of the line. This fixes that.
…essModifier
Previously the autocorrect implementation inserted a newline at the end of the access modifier
_node_ instead of at the end of the line. This fixes that.
When an access modifier has a comment on the same line and is not followed by an empty line, the autocorrection for
Style/EmptyLinesAroundAccessModifier
inserts the newline before the comment. I would expect it to insert the newline after the comment.(I discovered this while working on #4127 because this bug broke the
# rubocop:disable Lint/UselessAccessModifier
my change added to a line. I'm working on a fix.)Example
Expected correction
Actual correction
(one iteration)
Steps to reproduce
From an updated
rubocop
clone:git checkout fd25562
curl https://gist.githubusercontent.com/vergenzt/ac933335208576084a9e464e42f12ad6/raw/f15b4b6cabbf603032e9cc111be9ba2e7f4a0c1f/spec.diff | git apply
rspec spec/rubocop/cop/style/empty_lines_around_access_modifier_spec.rb
(Gist link)
RuboCop version
The text was updated successfully, but these errors were encountered: