lib/cc/yaml.rb
Avoid multi-line ternary operators, use if
or unless
instead. Open
Open
logger.warn key.empty? ? "#{file_name}: #{message}" :
"#{file_name}: #{key.join(?.)} section - #{message}"
- Read upRead up
- Exclude checks
This cop checks for multi-line ternary op expressions.
Example:
# bad
a = cond ?
b : c
a = cond ? b :
c
a = cond ?
b :
c
# good
a = cond ? b : c
a =
if cond
b
else
c
end
Do not use the character literal - use string literal instead. Open
Open
"#{file_name}: #{key.join(?.)} section - #{message}"
- Read upRead up
- Exclude checks
Checks for uses of the character literal ?x.
Example:
# bad
?x
# good
'x'
# good
?\C-\M-d