darcyWeb/app/models/room.rb
Do not use space inside array brackets. Open
Open
enum room_type: [ :classroom, :laboratory, :professor_room, :study_room, :amphitheater, :academic_center, :kitchen, :SAA, :others]
- Read upRead up
- Exclude checks
Checks that brackets used for array literals have or don't have surrounding space depending on configuration.
Example: EnforcedStyle: space
# The `space` style enforces that array literals have
# surrounding space.
# bad
array = [a, b, c, d]
# good
array = [ a, b, c, d ]
Example: EnforcedStyle: no_space
# The `no_space` style enforces that array literals have
# no surrounding space.
# bad
array = [ a, b, c, d ]
# good
array = [a, b, c, d]
Example: EnforcedStyle: compact
# The `compact` style normally requires a space inside
# array brackets, with the exception that successive left
# or right brackets are collapsed together in nested arrays.
# bad
array = [ a, [ b, c ] ]
# good
array = [ a, [ b, c ]]
Line is too long. [132/100] Open
Open
enum room_type: [ :classroom, :laboratory, :professor_room, :study_room, :amphitheater, :academic_center, :kitchen, :SAA, :others]
- Exclude checks
Use %i
or %I
for an array of symbols. Open
Open
enum room_type: [ :classroom, :laboratory, :professor_room, :study_room, :amphitheater, :academic_center, :kitchen, :SAA, :others]
- Read upRead up
- Exclude checks
This cop can check for array literals made up of symbols that are not using the %i() syntax.
Alternatively, it checks for symbol arrays using the %i() syntax on projects which do not want to use that syntax.
Configuration option: MinSize
If set, arrays with fewer elements than this value will not trigger the
cop. For example, a MinSize of
3` will not enforce a style on an array
of 2 or fewer elements.
Example: EnforcedStyle: percent (default)
# good
%i[foo bar baz]
# bad
[:foo, :bar, :baz]
Example: EnforcedStyle: brackets
# good
[:foo, :bar, :baz]
# bad
%i[foo bar baz]