Sha256: d01a8ee50a08a62f3b1f8668d553e5f5e7a55b7f32b06bb93758830e3ef1f48c

Contents?: true

Size: 572 Bytes

Versions: 1

Compression:

Stored size: 572 Bytes

Contents

# encoding: utf-8
require 'rails_best_practices/core/check'

module RailsBestPractices
  module Lexicals
    # Make sure there are no tabs in files.
    #
    class RemoveTabCheck < Core::Check
      # 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("\t") + 1
          add_error("remove tab, use spaces instead", filename, line_no)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails_best_practices-raydog153-0.9.1 lib/rails_best_practices/lexicals/remove_tab_check.rb