Class: Git::Lint::Analyzers::CommitAuthorEmail
- Defined in:
- lib/git/lint/analyzers/commit_author_email.rb
Constant Summary
Constants inherited from Abstract
Abstract::ISSUE_LINE_OFFSET, Abstract::LEVELS
Instance Attribute Summary
Attributes inherited from Abstract
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(commit:, settings: self.class.defaults, validator: Validators::Email) ⇒ CommitAuthorEmail
constructor
A new instance of CommitAuthorEmail.
- #issue ⇒ Object
- #valid? ⇒ Boolean
Methods inherited from Abstract
build_issue_line, descendants, #enabled?, #error?, id, inherited, #invalid?, label, #severity, #warning?
Constructor Details
#initialize(commit:, settings: self.class.defaults, validator: Validators::Email) ⇒ CommitAuthorEmail
Returns a new instance of CommitAuthorEmail.
14 15 16 17 |
# File 'lib/git/lint/analyzers/commit_author_email.rb', line 14 def initialize commit:, settings: self.class.defaults, validator: Validators::Email super commit: commit, settings: settings @validator = validator end |
Class Method Details
.defaults ⇒ Object
7 8 9 10 11 12 |
# File 'lib/git/lint/analyzers/commit_author_email.rb', line 7 def self.defaults { enabled: true, severity: :error } end |
Instance Method Details
#issue ⇒ Object
23 24 25 26 27 |
# File 'lib/git/lint/analyzers/commit_author_email.rb', line 23 def issue return {} if valid? {hint: %(Use "<name>@<server>.<domain>" instead of "#{commit.}".)} end |
#valid? ⇒ Boolean
19 20 21 |
# File 'lib/git/lint/analyzers/commit_author_email.rb', line 19 def valid? validator.new(commit.).valid? end |