Class: PRWithParams::ConventionalCommitValidator
- Inherits:
-
Object
- Object
- PRWithParams::ConventionalCommitValidator
- Defined in:
- lib/pr_with_params/options_validator.rb
Constant Summary collapse
- CONVENTIONAL_COMMIT_REGEX =
/^((build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(.*\))?(!)?(: (.*\s*)*))|(^Merge (.*\s*)*)|(^Initial commit$)/
Instance Method Summary collapse
-
#initialize(options) ⇒ ConventionalCommitValidator
constructor
A new instance of ConventionalCommitValidator.
- #validate! ⇒ Object
Constructor Details
#initialize(options) ⇒ ConventionalCommitValidator
Returns a new instance of ConventionalCommitValidator.
30 31 32 |
# File 'lib/pr_with_params/options_validator.rb', line 30 def initialize() @commit_message = [:title] end |
Instance Method Details
#validate! ⇒ Object
34 35 36 |
# File 'lib/pr_with_params/options_validator.rb', line 34 def validate! raise OptionsValidator::ValidatorError, "Conventional commit specifications not met for commit message: '#{@commit_message}'" unless valid_commit? end |