Skip to content
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 a cop that checks grouping of accessor methods #3983

Closed
Drenmi opened this issue Jan 29, 2017 · 3 comments · Fixed by #8241
Closed

Add a cop that checks grouping of accessor methods #3983

Drenmi opened this issue Jan 29, 2017 · 3 comments · Fixed by #8241
Assignees
Labels
feature request stale Issues that haven't been active in a while style guide Requires update(s) to the Ruby Style Guide

Comments

@Drenmi
Copy link
Collaborator

Drenmi commented Jan 29, 2017

As per this issue, there should be a cop that checks the grouping of attr_reader, attr_writer and attr_accessor, i.e. Style/AccessorGrouping.

All references to accessor methods in the style guide uses a grouped style, e.g.:

attr_reader :foo, :bar

and I think this should be the default. There is no explicit section on this however, so it should probably be added as part of work on this cop.

Note: accessor methods are affected by visibility scopes (public, protected, private) and the cop needs to take this into account.

@bbatsov
Copy link
Collaborator

bbatsov commented Sep 19, 2018

and I think this should be the default. There is no explicit section on this however, so it should probably be added as part of work on this cop.

Agreed.

@Drenmi Drenmi self-assigned this Sep 19, 2018
@Darhazer Darhazer added the style guide Requires update(s) to the Ruby Style Guide label Nov 1, 2018
@stale
Copy link

stale bot commented May 8, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution and understanding!

@stale stale bot added the stale Issues that haven't been active in a while label May 8, 2019
@stale
Copy link

stale bot commented Jun 7, 2019

This issues been automatically closed due to lack of activity. Feel free to re-open it if you ever come back to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request stale Issues that haven't been active in a while style guide Requires update(s) to the Ruby Style Guide
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants