@di-unternehmer/conventional-changelog-salesapp v1.0.1
Parser preset for commitlint
This is based on JIRA ticket system
The defined header types are:
- breaking
- type
- scope
- ticket
subject
Issue prefix:
#
Commit Message Header Pattern
The header (1st line) of a commit message has to follow this pattern:
header: (breaking?)type(scope?) [jira-ticket-number]: Not more then 72 chars in total on first line
The scope
and breaking
, inclusive the ()
, are optional.
The breaking
change is shown with !!!
before the type.
The []
and the ticket number is mandatory as well as :
inclusive a space before the sentence begins
The [jira-ticket-number]
has to follow the rule:
- 1-3 uppercase letters
- hyphen
- 1-4 digits EXAMPLE: A-1 to XXX-9999
Example
header pattern: type(scope?) [XX-123]: Not more then 72 chars in total on first line
Breaking Change:
header pattern: !!!type(scope?) [XXX-1234]: Not more then 72 chars in total on first line
Commit message example:
FEATURE(api) [SWN-1]: Headline of the ticket - or more helpfull message
Breaking Change:
!!!FEATURE(api) [SWN-1]: Headline of the ticket - or more helpfull message
Helpfull commands for development
Check parser
Run: docker run -it --rm commitlint:latest npx conventional-commits-parser -p '^(!!!)?(\w*)\(?(\w*)?\)?\s\[([A-Z]{1,3}-\d{1,4})\]:\s(.*)$' -c breaking,type,scope,ticket,subject
or if not in docker: npx conventional-commits-parser -p '^(!!!)?(\w*)\(?(\w*)?\)?\s\[([A-Z]{1,3}-\d{1,4})\]:\s(.*)$' -c breaking,type,scope,ticket,subject
Add header in interactive shell and press 3x Enter and you should see the parsed text as json array