Often times I only want to make the attr_reader public, but still define the attr_writer privately for internal use. However, with this cop enabled (especially with autocorrect turned on) this totally changes the access rules and therefore the API of the class.
I have no idea how easy this would be to implement, but it would be great if the cop could only "fire" (is that the correct term?) if the reader and writer have the same access level, i.e. both public, private, or protected.
Dup with #8253.
Ah, the above comment is my mistaken. this is a different cop that is similar to Style/AccessorGrouping cop.
Also just run into it when upgraded rubocop version.
Basic example:
class A
attr_reader :q
private
attr_writer :q
end
qwe.rb:2:15: C: Style/BisectedAttrAccessor: Combine both accessors into attr_accessor :q.
attr_reader :q
^^
qwe.rb:6:15: C: Style/BisectedAttrAccessor: Combine both accessors into attr_accessor :q.
attr_writer :q
^^
@koic could you reopen it?
Will look into this.