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
Add new Style/AccessorGrouping
cop
#8241
Conversation
d4e0e51
to
e35c957
Compare
Updated. |
FYI, this cop is not compatible with sorbet. See this example. This code: class Original
extend T::Sig
sig { returns(String) }
attr_reader :foo
sig { returns(Integer) }
attr_reader :bar
end Is auto corrected to this: class AutoCorrected
extend T::Sig
sig { returns(String) }
attr_reader :foo, :bar
sig { returns(Integer) }
end |
@ghiculescu I'm not super familiar with Sorbet yet, I imagine the "separated" style is fine. Is it mandatory, actually? I'm too lazy to look it up myself: if two readers are strings, can you write |
Yes, that works. The problems are
To be fair, I'm not sure if it's rubocop's responsibility to deal with that. i'm just commenting so other sorbet users are aware of this. |
I believe it warrants at least a note in the doc: #8828 I believe the cop already considers comments, but maybe our notion of "comment" should be expanded for |
Closes #3983