Module: RuboCop::Cop::SpaceAfterPunctuation

Included in:
Layout::SpaceAfterComma, Layout::SpaceAfterSemicolon
Defined in:
lib/rubocop/cop/mixin/space_after_punctuation.rb

Overview

Common functionality for cops checking for missing space after punctuation.

Constant Summary collapse

MSG =
'Space missing after %<token>s.'

Instance Method Summary collapse

Instance Method Details

#investigate(processed_source) ⇒ Object



10
11
12
13
14
15
# File 'lib/rubocop/cop/mixin/space_after_punctuation.rb', line 10

def investigate(processed_source)
  each_missing_space(processed_source.tokens) do |token|
    add_offense(token, location: token.pos,
                       message: format(MSG, token: kind(token)))
  end
end