-
-
Notifications
You must be signed in to change notification settings - Fork 284
Change Rails/HelperInstanceVariable
not to detect offenses for ivars within classes
#1538
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
base: master
Are you sure you want to change the base?
Conversation
42b6e84
to
00fe24d
Compare
Rails/HelperInstanceVariable
not to detect offenses for ivars within classesRails/HelperInstanceVariable
not to detect offenses for ivars within classes
00fe24d
to
95d9470
Compare
end | ||
|
||
it 'does not register an offense when a class which inherits `ActionView::Helpers::FormBuilder`' do | ||
it 'does not register an offense when an instance variable is defined within a class' do |
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.
Can you add it as a new test instead of updating the existing one?
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.
I've removed that one since there's nothing specific about ActionView::Helpers::FormBuilder
class anymore. Does it make sense to keep it?
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.
I thought it would be better to keep it as a working example from the past based on the feedback, but it’s not a strong opinion. Your opinion makes sense.
…s within classes Resolves rubocop#1525
95d9470
to
cfacd2b
Compare
end | ||
|
||
false | ||
def variable_belongs_to_class?(node) |
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.
Since the term variable
is broad, using instance_variable
would make it clearer.
def variable_belongs_to_class?(node) | |
def instance_variable_belongs_to_class?(node) |
Resolves #1525
[Fix #issue-number]
(if the related issue exists).master
(if not - rebase it).bundle exec rake default
. It executes all tests and runs RuboCop on its own code.{change_type}_{change_description}.md
if the new code introduces user-observable changes. See changelog entry format for details.