Class: Codeqa::Checkers::PatternChecker
- Inherits:
-
Codeqa::Checker
- Object
- Codeqa::Checker
- Codeqa::Checkers::PatternChecker
- Defined in:
- lib/codeqa/checkers/pattern_checker.rb
Direct Known Subclasses
CheckConflict, CheckLinkto, CheckPry, CheckRspecFocus, CheckStrangeChars
Instance Attribute Summary
Attributes inherited from Codeqa::Checker
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Codeqa::Checker
Constructor Details
This class inherits a constructor from Codeqa::Checker
Class Method Details
.available? ⇒ Boolean
11 12 13 |
# File 'lib/codeqa/checkers/pattern_checker.rb', line 11 def self.available? respond_to?(:pattern) end |
Instance Method Details
#check ⇒ Object
4 5 6 7 8 9 |
# File 'lib/codeqa/checkers/pattern_checker.rb', line 4 def check sourcefile.content.lines.each.with_index do |line, line_number| pos = (line =~ pattern) errors.add([line_number + 1, pos + 1], error_msg(line, line_number + 1, pos)) if pos end end |