Class: FitCommit::Validators::SubjectPeriod

Inherits:
Base
  • Object
show all
Defined in:
lib/fit_commit/validators/subject_period.rb

Instance Attribute Summary

Attributes inherited from Base

#branch_name, #config

Instance Method Summary collapse

Methods inherited from Base

#enabled?, inherited, #initialize, #matches_branch?, #validate

Methods included from HasErrors

#add_error, #add_warning, #clear_errors, #clear_warnings, #errors, #merge_errors, #merge_warnings, #warnings

Constructor Details

This class inherits a constructor from FitCommit::Validators::Base

Instance Method Details

#validate_line(lineno, text) ⇒ Object



6
7
8
9
10
# File 'lib/fit_commit/validators/subject_period.rb', line 6

def validate_line(lineno, text)
  if lineno == 1 && text.end_with?(".")
    add_error(lineno, "Do not end your subject line with a period.")
  end
end