🚦 Lint your gitmoji commits
Shareable commitlint
config enforcing gitmoji commit message styles. Use with commitlint .
TODO
Install dependencies
# use npm
npm i -D commitlint-config-gitmoji commitlint
or
# use pnpm
pnpm i -D commitlint-config-gitmoji commitlint
Add commitlint config for Gitmoji
echo "module.exports = {extends: ['gitmoji']};" > commitlint.config.js
the Gitmoji Structure of commit styles is below
:gitmoji: type(scope?): subject
body?
footer?
:sparkles: feat(changelog): support chinese title
:bug: fix(config): fix a subject bug
:memo: docs: update README.md
:bulb: docs(plugin): update comments
The following rules are considered problems for gitmoji commit
and will yield a non-zero exit code when not met.
Consult docs/rules for a list of available rules.
- condition:
type
is found in value - rule:
always
- value: Refer to @gitmoji/commiy-types
echo ":abc: some message" # fails
echo ":feat: some message" # passes
- description:
type
is in casevalue
- rule:
always
- value:
lowerCase
echo ":ART: Format some code" # fails
echo ":art: Format some code" # passes
- condition:
type
is empty - rule:
never
echo ": some message" # fails
echo ":fire: Delete some file" # passes
- condition:
scope
is in casevalue
- rule:
always
- value:
lowerCase
echo ":art:(SCOPE) some message" # fails
echo ":art:(scope) some message" # passes
- condition:
subject
must begin with['sentence-case', 'start-case', 'pascal-case', 'upper-case']
- rule:
always
echo ":art:(scope) Some Message" # pass
echo ":art:(scope) some message" # Fails
- condition:
subject
is empty - rule:
never
echo ":art: " # fails
echo ":art: some message" # passes
- condition:
subject
ends withvalue
- rule:
never
- value:
.
echo ":art: some message." # fails
echo ":art: some message" # passes
- condition:
header
hasvalue
or less characters - rule:
always
- value:
100
echo ":art: some message that is way too long and breaks the line max-length by several characters" # fails
echo ":art: some message" # passes
MIT ® Arvin Xu