Here we check if modifier keywords are preceded by a space.
# File lib/rubocop/cop/style/space_before_modifier_keyword.rb, line 9 def on_if(node) return unless modifier?(node) kw = node.loc.keyword b = kw.begin_pos left_of_kw = Parser::Source::Range.new(kw.source_buffer, b - 1, b) add_offense(node, left_of_kw) unless left_of_kw.is?(' ') end
Generated with the Darkfish Rdoc Generator 2.