Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: commit conventions awareness (#159)
* feat: commit convention awareness [wip] fix all-contributors/app#132 * refactor(commit-conventions): added a tranformer for `angular` and refactored `none` * feat(git): added lowercase transformation With some refactoring
- Loading branch information
1 parent
212e264
commit 2376ada
Showing
3 changed files
with
75 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
const conventions = { | ||
angular: { | ||
name: 'Angular', | ||
msg: 'docs:', | ||
lowercase: true, | ||
transform(msg) { | ||
return msg.replace( | ||
/(^.*?) ([A-Z][a-z]+) \w*/, | ||
(_, ...words) => `${words[0]} ${words[1].toLowerCase()} `, | ||
) | ||
}, | ||
}, | ||
atom: { | ||
name: 'Atom', | ||
msg: ':memo:', | ||
}, | ||
ember: { | ||
name: 'Ember', | ||
msg: '[DOC canary]', | ||
}, | ||
eslint: { | ||
name: 'ESLint', | ||
msg: 'Docs:', | ||
}, | ||
jshint: { | ||
name: 'JSHint', | ||
msg: '[[DOCS]]', | ||
}, | ||
none: { | ||
name: 'None', | ||
msg: '', | ||
}, | ||
} | ||
|
||
Object.keys(conventions).forEach(style => { | ||
conventions[style].value = style | ||
}) | ||
|
||
module.exports = conventions |
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