lib/cc/analyzer/source_buffer.rb
Group together all attr_reader
attributes. Open
Open
attr_reader :name
- Read upRead up
- Exclude checks
Checks for grouping of accessors in class
and module
bodies.
By default it enforces accessors to be placed in grouped declarations,
but it can be configured to enforce separating them in multiple declarations.
NOTE: Sorbet
is not compatible with "grouped" style. Consider "separated" style
or disabling this cop.
Example: EnforcedStyle: grouped (default)
# bad
class Foo
attr_reader :bar
attr_reader :baz
end
# good
class Foo
attr_reader :bar, :baz
end
Example: EnforcedStyle: separated
# bad
class Foo
attr_reader :bar, :baz
end
# good
class Foo
attr_reader :bar
attr_reader :baz
end
Group together all attr_reader
attributes. Open
Open
attr_reader :source
- Read upRead up
- Exclude checks
Checks for grouping of accessors in class
and module
bodies.
By default it enforces accessors to be placed in grouped declarations,
but it can be configured to enforce separating them in multiple declarations.
NOTE: Sorbet
is not compatible with "grouped" style. Consider "separated" style
or disabling this cop.
Example: EnforcedStyle: grouped (default)
# bad
class Foo
attr_reader :bar
attr_reader :baz
end
# good
class Foo
attr_reader :bar, :baz
end
Example: EnforcedStyle: separated
# bad
class Foo
attr_reader :bar, :baz
end
# good
class Foo
attr_reader :bar
attr_reader :baz
end