-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Errors like invalid commit format are non-descriptive, and make it hard to debug a problem. The error enum should prefer lots of very specific error cases as opposed to a few generic error cases:
conventional-commit/src/lib.rs
Lines 205 to 221 in dbd1eb2
| pub enum Error { | |
| /// The commit type is missing from the commit message. | |
| MissingType, | |
| /// The scope has an invalid format. | |
| InvalidScope, | |
| /// The description of the commit is missing. | |
| MissingDescription, | |
| /// The body of the commit has an invalid format. | |
| InvalidBody, | |
| /// Any other part of the commit does not conform to the conventional commit | |
| /// spec. | |
| InvalidFormat, | |
| } |
On top of that, we should probably switch to an Error struct, which contains an ErrorType enum, and some extra fields with more details about the error, to make it easier for libraries to inform the user what exactly went wrong, with which commit message.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request