diff --git a/@commitlint/format/src/index.js b/@commitlint/format/src/index.js index 2ef4065932..81ff37f00e 100644 --- a/@commitlint/format/src/index.js +++ b/@commitlint/format/src/index.js @@ -62,7 +62,7 @@ function formatResult(result = {}, options = {}) { const decoration = enabled ? chalk[color](sign) : sign; const summary = `${decoration} found ${errors.length} problems, ${ warnings.length - } warnings`; + } warnings \n (Need help? -> https://github.com/marionebl/commitlint#what-is-commitlint)`; return [...problems, enabled ? chalk.bold(summary) : summary]; } diff --git a/@commitlint/format/src/index.test.js b/@commitlint/format/src/index.test.js index b3ff2a28fe..2abae7bb66 100644 --- a/@commitlint/format/src/index.test.js +++ b/@commitlint/format/src/index.test.js @@ -3,7 +3,11 @@ import chalk from 'chalk'; import includes from 'lodash.includes'; import format from '.'; -const ok = chalk.bold(`${chalk.green('✔')} found 0 problems, 0 warnings`); +const ok = chalk.bold( + `${chalk.green( + '✔' + )} found 0 problems, 0 warnings \n (Need help? -> https://github.com/marionebl/commitlint#what-is-commitlint)` +); test('does nothing without arguments', t => { const actual = format(); diff --git a/README.md b/README.md index da21c41e75..4a866e025b 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,8 @@ ## Contents +* [What is commitlint](#what-is-commitlint) + * [Benefits using commitlint](#benefits-using-commitlint) * [Getting started](#getting-started) * [CLI](#cli) * [Config](#config) @@ -35,6 +37,43 @@ * * * +## What is commitlint +commitlint checks if your commit messages meet the [conventional commit format](https://conventionalcommits.org). + +In general the pattern mostly looks like this: +```sh +type(scope?): subject #scope is optional +``` +Real world examples can look like this: +``` +chore: run tests on travis ci +``` +``` +fix(server): send cors headers +``` +``` +feat(blog): add comment section +``` +Common types according to [commitlint-config-conventional (based on the the Angular convention)](https://github.com/marionebl/commitlint/tree/master/%40commitlint/config-conventional#type-enum) can be: +- build +- ci +- chore +- docs +- feat +- fix +- perf +- refactor +- revert +- style +- test + +These can be modified by [your own configuration](#config). + +### Benefits using commitlint +- [Why Use Conventional Commits?](https://www.conventionalcommits.org/en/v1.0.0-beta.2/#why-use-conventional-commits) +- ["The perks of committing with conventions" (Talk slides)](https://slides.com/marionebl/the-perks-of-committing-with-conventions#/) + + ## Getting started ```sh