Sha256: 6901ac72e1ff935764ab2e846c3b993cca0a447c6c1083efbbb6b39efbbac7b1
Contents?: true
Size: 719 Bytes
Versions: 10
Compression:
Stored size: 719 Bytes
Contents
# encoding: utf-8 module RailsBestPractices module Lexicals # Make sure there are no tabs in files. # # See the best practice details here http://rails-bestpractices.com/posts/81-remove-tab class RemoveTabCheck < Core::Check interesting_files ALL_FILES url "http://rails-bestpractices.com/posts/81-remove-tab" # check if the content of file contains a tab. # # @param [String] filename name of the file # @param [String] content content of the file 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 end end end
Version data entries
10 entries across 10 versions & 1 rubygems