Sha256: 81918466e1ebe54f18b3c45589d27147e465dfb3118a6a64192a726ce924ec95
Contents?: true
Size: 471 Bytes
Versions: 6
Compression:
Stored size: 471 Bytes
Contents
# encoding: utf-8 module RuboCop module Cop module Style # Checks for uses of semicolon in if statements. class IfWithSemicolon < Cop include OnNormalIfUnless MSG = 'Never use if x; Use the ternary operator instead.' def on_normal_if_unless(node) beginning = node.loc.begin return unless beginning && beginning.is?(';') add_offense(node, :expression, MSG) end end end end end
Version data entries
6 entries across 6 versions & 2 rubygems