Skip to content

Commit 78db7df

Browse files
committed
docs: rework root readme
1 parent b55693c commit 78db7df

File tree

1 file changed

+33
-59
lines changed

1 file changed

+33
-59
lines changed

readme.md

Lines changed: 33 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -6,87 +6,61 @@
66
* 🤖 Plays nice with `conventional-changelog`
77
* 📦 Supports shareable configuration
88

9-
## CLI
10-
11-
* Primary way to interact with commitlint.
12-
* Install `@commitlint/cli`
13-
* Packages: [cli](./@commitlint/cli)
9+
## Getting started
1410

1511
```
16-
❯ npm install -g @commitlint/cli
17-
18-
❯ commitlint --help
19-
commitlint - Lint commit messages
12+
npm install --save-dev @commitlint/{angular,cli}
13+
echo '{"extends": ["@commitlint/config-angular"]}' > .commitlintrc
14+
```
2015

21-
[input] reads from stdin if --edit, --from and --to are omitted
22-
--color,-c toggle formatted output, defaults to: true
23-
--edit,-e read last commit message found in ./git/COMMIT_EDITMSG
24-
--extends,-x array of shareable configurations to extend
25-
--from,-f lower end of the commit range to lint; applies if edit=false
26-
--to,-t upper end of the commit range to lint; applies if edit=false
27-
--quiet,-q toggle console output
16+
## CLI
2817

29-
```
18+
* Primary way to interact with commitlint.
19+
* `npm install --save-dev @commitlint/cli`
20+
* Packages: [cli](./@commitlint/cli)
3021

3122
## Config
3223

3324
* Configuration is picked up from `.commitlint` files
3425
* Packages: [cli](./@commitlint/cli), [core](./@commitlint/core)
3526
* See [Rules](./docs/rules) for a complete list of possible rules
27+
* An example configurations can be found at [@commitlint/config-angular](./@commitlint/config-angular/index.js)
28+
29+
## Shared configurations
30+
31+
A number of shared configurations are available to install and use with `commitlint`:
32+
33+
* [@commitlint/config-angular](./@commitlint/config-angular)
34+
* [@commitlint/config-lerna-scopes](./@commitlint/config-lerna-scopes)
35+
* [@commitlint/config-patternplate](./@commitlint/config-patternplate)
36+
* [conventional-changelog-lint-config-atom](https://github.com/erikmueller/conventional-changelog-lint-config-atom)
37+
* [conventional-changelog-lint-config-canonical](https://github.com/gajus/conventional-changelog-lint-config-canonical)
3638

37-
```js
38-
{
39-
"extends": ["@commitlint/config-angular"], // pull in rules from packages
40-
"rules": { // overriding rules from extended packages
41-
"body-leading-blank": [0], // disable rule body-leading-blank,
42-
"footer-leading-blank": [1, "always"], // footer-leading-blank is a warning if not met
43-
"body-tense": [2, "always", ["present-imperative"]], // body-tense is an error if not met
44-
}
45-
}
46-
```
4739

4840
## API
4941

5042
* Alternative, programatic way to interact with `commitlint`
51-
* Install `@commitlint/core`
43+
* `npm install --save @commitlint/core`
5244
* Packages: [core](./@commitlint/core)
53-
* See [API](./docs/api) for a complete list of methods and parameters
54-
55-
```js
56-
// example
57-
const {lint} = require('@commitlint/core');
58-
59-
// Pass in configuration manually
60-
lint('docs: add node api', {
61-
configuration: {
62-
rules: {
63-
'scope-empty': [2, 'never']
64-
}
65-
}
66-
})
67-
.then(report => {
68-
console.log(JSON.stringify(report, null, ' '));
69-
});
70-
/* => {
71-
"valid": false,
72-
"errors": [
73-
{
74-
"level": 2,
75-
"valid": false,
76-
"name": "scope-empty",
77-
"message": "scope may not be empty"
78-
}
79-
],
80-
"warnings": []
81-
} */
82-
```
45+
* See [API](./docs/api) for a complete list of methods and examples
8346

8447
## Tools
8548

86-
* [prompt](./@commitlint/prompt)
49+
* [prompt](./@commitlint/prompt)
50+
51+
## Version Support
52+
53+
* Node.js [LTS](https://github.com/nodejs/LTS#lts-schedule) version and higher: `>= 4`
54+
* git `>= 2`
8755

8856
## Related projects
8957

58+
* [angular-precommit](https://git.io/vwTDd) – Pre commit with angular conventions
59+
* [conventional-changelog](https://git.io/v18sw) – Generate a changelog from conventional commit history
60+
* [conventional-commits-detector](https://git.io/vwTyk) – Detect what commit message convention your repository is using
61+
* [conventional-github-releaser](https://git.io/vwTyI) – Make a new GitHub release from git metadata
62+
* [commitizen](https://git.io/vwTym) – Simple commit conventions for internet citizens
63+
9064
## License
9165
Copyright by @marionebl. All `commitlint` packages are released under the MIT license.
9266

0 commit comments

Comments
 (0)