-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(build): #769.1 add commit lint config
- Add commit lint config files
- Loading branch information
Luis Saavedra
committed
Dec 1, 2021
1 parent
182d9a3
commit 434b512
Showing
3 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
const HEADERLENGTHMAX = 60; | ||
const LINELENGTHMAX = 72; | ||
const BODYLENGTHMIN = 15; | ||
|
||
module.exports = { | ||
parserPreset: './.commitlint-parser-preset', | ||
rules: { | ||
|
||
// Body | ||
'body-leading-blank': [2, 'always'], // blank line between header and body | ||
'body-empty': [2, 'never'], // body cannot be empty | ||
'body-max-line-length': [2, 'always', LINELENGTHMAX], // body lines max chars LINELENGTHMAX | ||
'body-min-length' : [2, 'always', BODYLENGTHMIN], // body more than BODYLENGTHMIN chars | ||
|
||
// Footer | ||
'footer-leading-blank': [2, 'always'], // blank line between body and footer | ||
'footer-max-line-length': [2, 'always', LINELENGTHMAX], // footer lines max chars LINELENGTHMAX | ||
|
||
// Header | ||
'header-case': [2, 'always', 'lower-case'], // header lower case | ||
'header-max-length': [2, 'always', HEADERLENGTHMAX], // header max chars HEADERLENGTHMAX | ||
|
||
// Scope | ||
'scope-empty': [2, 'never'], // scope always | ||
'scope-enum': [ | ||
2, | ||
'always', | ||
[ | ||
'front', // Front-End change | ||
'back', // Back-End change | ||
'infra', // Infrastructure change | ||
'conf', // Configuration files change | ||
'build', // System component change (ci, scons, webpack...) | ||
'job', // asynchronous or schedule tasks (backups, maintainance...) | ||
'cross', // Mix of two or more scopes | ||
'doc', // Documentation only changes | ||
], | ||
], | ||
|
||
// Subject (commit title without type and scope) | ||
'subject-case': [2, 'always', 'lower-case'], // subject lower-case | ||
'subject-empty': [2, 'never'], // subject always | ||
|
||
// Type | ||
'type-empty': [2, 'never'], //type always | ||
'type-enum': [ | ||
2, | ||
'always', | ||
[ | ||
'feat', // New feature | ||
'perf', // Improves performance | ||
'fix', // Bug fix | ||
'rever', // Revert to a previous commit in history | ||
'style', // Do not affect the meaning of the code (formatting, etc) | ||
'refac', // Neither fixes a bug or adds a feature | ||
'test', // Adding missing tests or correcting existing tests | ||
], | ||
], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
parserOpts: { | ||
headerPattern: /^(\w*)\((\w*)\):\s(#[0-9]\d*)(.\d+)?\s(.*)$/, | ||
headerCorrespondence: [ 'type', 'scope', 'ticket', 'part', 'subject' ], | ||
}, | ||
}; |