lib/mastermind_sname/sname/message.rb
Favor a normal if-statement over a modifier clause in a multiline statement. Open
Open
@colours = "(r)ed, (g)reen, (y)ellow, (b)lue, (o)"\
"range, (v)iolet" if colours.length == 8
- Read upRead up
- Exclude checks
Checks for uses of if/unless modifiers with multiple-lines bodies.
Example:
# bad
{
result: 'this should not happen'
} unless cond
# good
{ result: 'ok' } if cond
Favor a normal if-statement over a modifier clause in a multiline statement. Open
Open
@colours = "(r)ed, (g)reen, (y)ellow, (b)lue, (o)"\
"range" if colours.length == 6
- Read upRead up
- Exclude checks
Checks for uses of if/unless modifiers with multiple-lines bodies.
Example:
# bad
{
result: 'this should not happen'
} unless cond
# good
{ result: 'ok' } if cond