RuboCop::Cop
Checks for uses of semicolon in if statements.
# File lib/rubocop/cop/style/if_with_semicolon.rb, line 13 def error_message(_node) 'Never use if x; Use the ternary operator instead.' end
# File lib/rubocop/cop/style/if_with_semicolon.rb, line 9 def offending_line(node) node.loc.begin.line if node.loc.begin && node.loc.begin.is?(';') end
[Validate]
Generated with the Darkfish Rdoc Generator 2.