class RailsBestPractices::Lexicals::RemoveTabCheck

Make sure there are no tabs in files.

See the best practice details here rails-bestpractices.com/posts/2011/07/04/remove-tab/

Public Instance Methods

check(filename, content) click to toggle source

check if the content of file contains a tab.

@param [String] filename name of the file @param [String] content content of the file

# File lib/rails_best_practices/lexicals/remove_tab_check.rb, line 16
def check(filename, content)
  if content =~ /\t/m
    line_no = $`.count("\n") + 1
    add_error('remove tab, use spaces instead', filename, line_no)
  end
end