lib/rubocop/cop/mixin/space_before_punctuation.rb in rubocop-1.18.4 vs lib/rubocop/cop/mixin/space_before_punctuation.rb in rubocop-1.19.0
- old
+ new
@@ -8,10 +8,10 @@
include RangeHelp
MSG = 'Space found before %<token>s.'
def on_new_investigation
- each_missing_space(processed_source.tokens) do |token, pos_before|
+ each_missing_space(processed_source.sorted_tokens) do |token, pos_before|
add_offense(pos_before, message: format(MSG, token: kind(token))) do |corrector|
PunctuationCorrector.remove_space(corrector, pos_before)
end
end
end