Class: Git::Lint::Analyzers::CommitTrailerCollaboratorName
- Defined in:
- lib/git/lint/analyzers/commit_trailer_collaborator_name.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, parser: Parsers::Trailers::Collaborator, validator: Validators::Name) ⇒ CommitTrailerCollaboratorName
constructor
rubocop:disable Metrics/ParameterLists.
- #issue ⇒ Object
-
#valid? ⇒ Boolean
rubocop:enable Metrics/ParameterLists.
Methods inherited from Abstract
build_issue_line, descendants, #enabled?, #error?, id, inherited, #invalid?, label, #severity, #warning?
Constructor Details
#initialize(commit:, settings: self.class.defaults, parser: Parsers::Trailers::Collaborator, validator: Validators::Name) ⇒ CommitTrailerCollaboratorName
rubocop:disable Metrics/ParameterLists
16 17 18 19 20 21 22 23 24 |
# File 'lib/git/lint/analyzers/commit_trailer_collaborator_name.rb', line 16 def initialize commit:, settings: self.class.defaults, parser: Parsers::Trailers::Collaborator, validator: Validators::Name super commit: commit, settings: settings @parser = parser @validator = validator end |
Class Method Details
.defaults ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/git/lint/analyzers/commit_trailer_collaborator_name.rb', line 7 def self.defaults { enabled: true, severity: :error, minimum: 2 } end |
Instance Method Details
#issue ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'lib/git/lint/analyzers/commit_trailer_collaborator_name.rb', line 31 def issue return {} if valid? { hint: "Name must follow key and consist of #{minimum} parts (minimum).", lines: affected_commit_trailers } end |
#valid? ⇒ Boolean
rubocop:enable Metrics/ParameterLists
27 28 29 |
# File 'lib/git/lint/analyzers/commit_trailer_collaborator_name.rb', line 27 def valid? affected_commit_trailers.empty? end |