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 0.80.0 is reporting offences for marking existing methods as private, even when the method is not defined within the scope it is marked private in.
Furthermore, the message produced by the offence is misleading.
Expected behavior
I expect to be able to mark methods introduced by reflection or otherwise defined outside of the current scope as protected or private.
Actual behavior
Consider a hypothetical example using a Rails model:
The rubocop offence is reported on the private :slug= line:
private should not be inlined in method definitions. (convention:Style/AccessModifierDeclarations)
The reported offence is incorrect since:
The line is not a method definition, hence the error message is incorrect and misleading.
The line affects a method that is not defined by application code. It is created by Rails based on the connected database schema, and its natural access modifier is outside of application control.
RuboCop 0.80.0 is reporting offences for marking existing methods as private, even when the method is not defined within the scope it is marked private in.
Furthermore, the message produced by the offence is misleading.
Expected behavior
I expect to be able to mark methods introduced by reflection or otherwise defined outside of the current scope as protected or private.
Actual behavior
Consider a hypothetical example using a Rails model:
The rubocop offence is reported on the
private :slug=
line:The reported offence is incorrect since:
Steps to reproduce the problem
Minimum case to reproduce:
The error message is produced:
The line neither defines a method, nor does class
Foo
itself declare the methodbar
.RuboCop version
The text was updated successfully, but these errors were encountered: