Parent

Methods

Files

Class/Module Index [+]

Quicksearch

RuboCop::Cop::Style::Tab

This cop checks for tabs inside the source code.

Constants

MSG

Public Instance Methods

investigate(processed_source) click to toggle source
# File lib/rubocop/cop/style/tab.rb, line 9
def investigate(processed_source)
  processed_source.lines.each_with_index do |line, index|
    match = line.match(/^( *)\t/)
    next unless match

    spaces = match.captures[0]
    add_offense(nil,
                source_range(processed_source.buffer,
                             processed_source[0...index],
                             spaces.length, 1),
                MSG)
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.