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
which IMHO has poorer readability compared to the original.
Describe the solution you'd like
A config option to allow having keywords such as private, protected, public, alias, alias_method, etc to immediately follow the attr*.
(N.B.: I don't want to enforce this, just have such occurrences ignored by the cop)
Describe alternatives you've considered
Exclude the file for the cop in .rubocop.yml
The text was updated successfully, but these errors were encountered:
…ributeAccessor`
Fixesrubocop#7976 and rubocop#7981
This PR adds `AllowAliasSyntax` and `AllowedMethods` options.
for `Layout/EmptyLinesAroundAttributeAccessor` cop.
Users can configure a behavior for `alias` syntax using
`IgnoreAliasSyntax` option. Ignored by default (true).
And users can specify ignored methods using `AllowedMethods`.
By default, set `alias_method`, `public`, `protected`, and
`private` provided by Ruby.
`cattr_accessor`, `attribute`, other methods provided by Rails (and other gems)
can be set by user applications or RuboCop Rails gem.
…ccessor`
Fixes#7976 and #7981
This PR adds `AllowAliasSyntax` and `AllowedMethods` options.
for `Layout/EmptyLinesAroundAttributeAccessor` cop.
Users can configure a behavior for `alias` syntax using
`IgnoreAliasSyntax` option. Ignored by default (true).
And users can specify ignored methods using `AllowedMethods`.
By default, set `alias_method`, `public`, `protected`, and
`private` provided by Ruby.
`cattr_accessor`, `attribute`, other methods provided by Rails (and other gems)
can be set by user applications or RuboCop Rails gem.
Is your feature request related to a problem? Please describe.
Say, I have the following class;
Layout/EmptyLineAroundAttributeAccessor
cop recommends that my class be refactored into:which IMHO has poorer readability compared to the original.
Describe the solution you'd like
A config option to allow having keywords such as
private
,protected
,public
,alias
,alias_method
, etc to immediately follow theattr*
.(N.B.: I don't want to enforce this, just have such occurrences ignored by the cop)
Describe alternatives you've considered
Exclude the file for the cop in
.rubocop.yml
The text was updated successfully, but these errors were encountered: