Class: Danger::DangerAngularCommitLint::SubjectCapCheck

Inherits:
CommitCheck
  • Object
show all
Defined in:
lib/angular_commit_lint/subject_cap_check.rb

Overview

:nodoc:

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from CommitCheck

fail?

Constructor Details

#initialize(message, _config = {}) ⇒ SubjectCapCheck

Returns a new instance of SubjectCapCheck.



14
15
16
# File 'lib/angular_commit_lint/subject_cap_check.rb', line 14

def initialize(message, _config = {})
  @first_character = extract_subject(message).split('').first
end

Class Method Details

.typeObject



10
11
12
# File 'lib/angular_commit_lint/subject_cap_check.rb', line 10

def self.type
  :subject_cap
end

Instance Method Details

#fail?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/angular_commit_lint/subject_cap_check.rb', line 18

def fail?
  @first_character != @first_character.upcase
end

#messageObject



6
7
8
# File 'lib/angular_commit_lint/subject_cap_check.rb', line 6

def message
  'Please start subject with capital letter.'.freeze
end