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
class A
class << self
private
def foo
end
end
def bar
baz.bar
end
end
Rails/Delegate doesn't produce an offence for def bar. Removing the private on line 3 however correctly triggers the cop. Note that the bar method itself is not private.
Expected behavior
An offence for the delegation. Inner classes' private declarations should be ignored when checking whether this is a private delegation. Note that this also would be ignored while it should not:
class A
class B
private
def foo
end
end
def bar
baz.bar
end
end
Actual behavior
no offences detected
Steps to reproduce the problem
This is extremely important! Providing us with a reliable way to reproduce
a problem will expedite its solution.
RuboCop version
Include the output of rubocop -V or bundle exec rubocop -V if using Bundler. Here's an example:
You can see extension cop versions (e.g. rubocop-rails, rubocop-performance, and others) output by rubocop -V,
include them as well. Here's an example:
Given the code:
Rails/Delegate doesn't produce an offence for
def bar
. Removing theprivate
on line 3 however correctly triggers the cop. Note that thebar
method itself is not private.Expected behavior
An offence for the delegation. Inner classes'
private
declarations should be ignored when checking whether this is a private delegation. Note that this also would be ignored while it should not:Actual behavior
no offences detected
Steps to reproduce the problem
This is extremely important! Providing us with a reliable way to reproduce
a problem will expedite its solution.
RuboCop version
Include the output of
rubocop -V
orbundle exec rubocop -V
if using Bundler. Here's an example:You can see extension cop versions (e.g. rubocop-rails, rubocop-performance, and others) output by rubocop -V,
include them as well. Here's an example:
The text was updated successfully, but these errors were encountered: