Sha256: f5dd349e40f7581181ac3c9fae5acc2c21b2cd20761c116e5389965506b10afc
Contents?: true
Size: 437 Bytes
Versions: 9
Compression:
Stored size: 437 Bytes
Contents
# encoding: utf-8 module Rubocop module Cop module Style # Checks for uses of semicolon in if statements. class IfWithSemicolon < Cop include IfThenElse def offending_line(node) node.loc.begin.line if node.loc.begin && node.loc.begin.is?(';') end def error_message(_node) 'Never use if x; Use the ternary operator instead.' end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems