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

#on_new_investigationObject



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

def on_new_investigation
  each_missing_space(processed_source.tokens) do |token|
    add_offense(token.pos, message: format(MSG, token: kind(token))) do |corrector|
      PunctuationCorrector.add_space(corrector, token)
    end
  end
end