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
Rubocop replaces end with nd when using rubocop-rails_config
I am not certain whether this bug even belongs into rubocop or into one of the related gems. This bug does not happen if use strictly rubocop without the gem rubocop-rails_config. In the end the decision to change the end to nd is made by rubocop, therefore I assume that it must be a bug in rubocop triggerd by an unusual configuration.
This is the most minimal amount of code to trigger this bug from my current point of view.
Expected behavior
Rubocop should not replace an end with nd in this minimal example:
…ccessModifier`
Fixesrubocop#8232.
This PR fixes a false positive and an incorrect auto-correct for
`Layout/EmptyLinesAroundAccessModifier` when `end` immediately
after access modifier.
…difier`
Fixes#8232.
This PR fixes a false positive and an incorrect auto-correct for
`Layout/EmptyLinesAroundAccessModifier` when `end` immediately
after access modifier.
Rubocop replaces
end
withnd
when using rubocop-rails_configI am not certain whether this bug even belongs into rubocop or into one of the related gems. This bug does not happen if use strictly rubocop without the gem rubocop-rails_config. In the end the decision to change the
end
tond
is made by rubocop, therefore I assume that it must be a bug in rubocop triggerd by an unusual configuration.This is the most minimal amount of code to trigger this bug from my current point of view.
Expected behavior
Rubocop should not replace an
end
withnd
in this minimal example:Actual behavior
Rubocop replaced the
end
withnd
and therefore created invalid code.Steps to reproduce the problem
Files
Clone the example repo: rubocop_bug or
To reproduce run:
bundle install
bundle exec rubocop -a --safe
git diff
end
in the end of the file was replaced withnd
git diff
diff --git a/user_controller.rb b/user_controller.rb --- a/user_controller.rb +++ b/user_controller.rb @@ -1,3 +1,3 @@ class UsersController < ApplicationController private -end +nd
RuboCop version
The text was updated successfully, but these errors were encountered: