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 new Style/BisectedAttrAccessor cop #8244

Merged
merged 1 commit into from Jul 6, 2020

Conversation

fatkodima
Copy link
Contributor

This cop checks where attr_reader :foo and attr_writer :foo can be combined into attr_accessor :foo.

I was surprised when I haven't found a similar check.

There were a couple of offenses in my project, that stayed after not so careful refactoring. So I would like to have a cop with suggestions.

@bbatsov
Copy link
Collaborator

bbatsov commented Jul 6, 2020

Great work! I'm guessing the cop should also cover the somewhat deprecated attr, which I think was an alias for attr_reader.

@fatkodima
Copy link
Contributor Author

Updated with suggestions.

@bbatsov bbatsov merged commit cc5f42f into rubocop:master Jul 6, 2020
@bbatsov
Copy link
Collaborator

bbatsov commented Jul 6, 2020

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants