Sha256: 4bc4bbd42ad4dc77d2ae8b969513751a31ae796b8d09a41282a2f34ae8581c81
Contents?: true
Size: 472 Bytes
Versions: 15
Compression:
Stored size: 472 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 = 'Do not 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
15 entries across 15 versions & 1 rubygems