Class: Guideline::TrailingWhitespaceChecker

Inherits:
Checker
  • Object
show all
Defined in:
lib/guideline/checkers/trailing_whitespace_checker.rb

Instance Method Summary collapse

Methods inherited from Checker

#errors, #has_error?, #initialize, #report

Constructor Details

This class inherits a constructor from Guideline::Checker

Instance Method Details

#check(path) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/guideline/checkers/trailing_whitespace_checker.rb', line 3

def check(path)
  path.each_line.with_index do |line, index|
    if line =~ / $/
      report(
        :message => "Remove trailing whitespace",
        :path    => path,
        :line    => index + 1
      )
    end
  end
end