Skip to content

Commit de582db

Browse files
authored
docs: corrects minor grammar errors and typos in the README (#822)
1 parent 04e4b4d commit de582db

File tree

1 file changed

+42
-45
lines changed

1 file changed

+42
-45
lines changed

README.md

+42-45
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@ When you commit with Commitizen, you'll be prompted to fill out any required com
77

88
## Installing the command line tool
99

10-
Commitizen is currently tested against
11-
node 10 and 12 although it may work in
12-
older node. You should also have npm 6
13-
or greater.
10+
Commitizen is currently tested against Node.js 10 and 12 although it may work in
11+
older versions of Node.js. You should also have npm 6 or greater.
1412

1513
Installation is as simple as running the following command (if you see `EACCES` error, reading [fixing npm permissions](https://docs.npmjs.com/getting-started/fixing-npm-permissions) may help):
1614

@@ -20,11 +18,11 @@ npm install -g commitizen
2018

2119
## Using the command line tool
2220

23-
### If your repo is [Commitizen-friendly]:
21+
### If your repo is [Commitizen friendly](#making-your-repo-commitizen-friendly):
2422

2523
Simply use `git cz` or just `cz` instead of `git commit` when committing. You can also use `git-cz`, which is an alias for `cz`.
2624

27-
_Alternatively_, if you are using **NPM 5.2+** you can [use `npx`](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b) instead of installing globally:
25+
_Alternatively_, if you are using **npm 5.2+** you can [use `npx`](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b) instead of installing globally:
2826

2927
```sh
3028
npx cz
@@ -39,19 +37,19 @@ or as an npm script:
3937
}
4038
```
4139

42-
When you're working in a Commitizen friendly repository, you'll be prompted to fill in any required fields and your commit messages will be formatted according to the standards defined by project maintainers.
40+
When you're working in a Commitizen-friendly repository, you'll be prompted to fill in any required fields, and your commit messages will be formatted according to the standards defined by project maintainers.
4341

4442
[![Add and commit with Commitizen](https://github.com/commitizen/cz-cli/raw/master/meta/screenshots/add-commit.png)](https://github.com/commitizen/cz-cli/raw/master/meta/screenshots/add-commit.png)
4543

4644
### If your repo is NOT Commitizen friendly:
4745

48-
If you're **not** working in a Commitizen friendly repository, then `git cz` will work just the same as `git commit` but `npx cz` will use the [streamich/git-cz](https://github.com/streamich/git-cz) adapter. To fix this, you need to first [make your repo Commitizen-friendly](#making-your-repo-commitizen-friendly)
46+
If you're **not** working in a Commitizen-friendly repository, then `git cz` will work just the same as `git commit`, but `npx cz` will use the [streamich/git-cz](https://github.com/streamich/git-cz) adapter. To fix this, you need to first [make your repo Commitizen friendly](#making-your-repo-commitizen-friendly)
4947

50-
## Making your repo Commitizen-friendly
48+
## Making your repo Commitizen friendly
5149

52-
For this example, we'll be setting up our repo to use [AngularJS's commit message convention](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines) also known as [conventional-changelog](https://github.com/ajoslin/conventional-changelog).
50+
For this example, we'll be setting up our repo to use [AngularJS's commit message convention](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines), also known as [conventional-changelog](https://github.com/ajoslin/conventional-changelog).
5351

54-
First, install the Commitizen cli tools:
52+
First, install the Commitizen CLI tools:
5553

5654
```sh
5755
npm install commitizen -g
@@ -71,11 +69,11 @@ commitizen init cz-conventional-changelog --yarn --dev --exact
7169

7270
Note that if you want to force install over the top of an old adapter, you can apply the `--force` argument. For more information on this, just run `commitizen help`.
7371

74-
The above command does three things for you.
72+
The above command does three things for you:
7573

7674
1. Installs the cz-conventional-changelog adapter npm module
77-
2. Saves it to package.json's dependencies or devDependencies
78-
3. Adds the `config.commitizen` key to the root of your **package.json** as shown here:
75+
2. Saves it to `package.json`'s `dependencies` or `devDependencies`
76+
3. Adds the `config.commitizen` key to the root of your `package.json` file as shown here:
7977

8078
```json
8179
...
@@ -86,7 +84,7 @@ The above command does three things for you.
8684
}
8785
```
8886

89-
Alternatively, commitizen configs may be added to a .czrc file:
87+
Alternatively, Commitizen configs may be added to a `.czrc` file:
9088

9189
```json
9290
{
@@ -96,33 +94,33 @@ Alternatively, commitizen configs may be added to a .czrc file:
9694

9795
This just tells Commitizen which adapter we actually want our contributors to use when they try to commit to this repo.
9896

99-
`commitizen.path` is resolved via [require.resolve](https://nodejs.org/api/globals.html#globals_require_resolve) and supports
97+
`commitizen.path` is resolved via [require.resolve](https://nodejs.org/api/globals.html#globals_require_resolve) and supports:
10098

10199
- npm modules
102100
- directories relative to `process.cwd()` containing an `index.js` file
103-
- file base names relative to `process.cwd()` with `js` extension
101+
- file base names relative to `process.cwd()` with `.js` extension
104102
- full relative file names
105-
- absolute paths.
103+
- absolute paths
106104

107-
Please note that in the previous version of Commitizen we used czConfig. **czConfig has been deprecated** and you should migrate to the new format before Commitizen 3.0.0.
105+
Please note that in the previous version of Commitizen we used czConfig. **czConfig has been deprecated**, and you should migrate to the new format before Commitizen 3.0.0.
108106

109107
### Optional: Install and run Commitizen locally
110108

111109
Installing and running Commitizen locally allows you to make sure that developers are running the exact same version of Commitizen on every machine.
112110

113111
Install Commitizen with `npm install --save-dev commitizen`.
114112

115-
On **NPM 5.2+** you can [use `npx`](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b) to initialize the conventional changelog adapter:
113+
On **npm 5.2+** you can [use `npx`](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b) to initialize the conventional changelog adapter:
116114

117115
```
118116
npx commitizen init cz-conventional-changelog --save-dev --save-exact
119117
```
120118

121-
For **previous versions of NPM (< 5.2)** you can execute `./node_modules/.bin/commitizen` or `./node_modules/.bin/cz` in order to actually use the commands.
119+
For **previous versions of npm (< 5.2)** you can execute `./node_modules/.bin/commitizen` or `./node_modules/.bin/cz` in order to actually use the commands.
122120

123121
You can then initialize the conventional changelog adapter using: `./node_modules/.bin/commitizen init cz-conventional-changelog --save-dev --save-exact`
124122

125-
And you can then add some nice npm run scripts in your package.json pointing to the local version of commitizen:
123+
And you can then add some nice npm scripts in your `package.json` file pointing to the local version of Commitizen:
126124

127125
```json
128126
...
@@ -133,9 +131,9 @@ And you can then add some nice npm run scripts in your package.json pointing to
133131

134132
This will be more convenient for your users because then if they want to do a commit, all they need to do is run `npm run commit` and they will get the prompts needed to start a commit!
135133

136-
> **NOTE:** if you are using `precommit` hooks thanks to something like [`husky`](https://www.npmjs.com/package/husky), you will need to name your script some thing other than `"commit"`
137-
> (e.g. `"cm": "cz"`). The reason is because npm-scripts has a "feature" where it automatically runs scripts with the name _prexxx_ where _xxx_ is the name of another script. In essence,
138-
> npm and husky will run `"precommit"` scripts twice if you name the script `"commit"`, and the work around is to prevent the npm-triggered _precommit_ script.
134+
> **NOTE:** If you are using `precommit` hooks thanks to something like [`husky`](https://www.npmjs.com/package/husky), you will need to name your script something other than `"commit"`
135+
> (e.g. `"cm": "cz"`). The reason is because npm scripts has a "feature" where it automatically runs scripts with the name _prexxx_ where _xxx_ is the name of another script. In essence,
136+
> npm and husky will run `"precommit"` scripts twice if you name the script `"commit"`, and the workaround is to prevent the npm-triggered _precommit_ script.
139137
140138
#### Optional: Running Commitizen on `git commit`
141139

@@ -157,7 +155,7 @@ exec < /dev/tty && node_modules/.bin/cz --hook || true
157155

158156
##### Husky
159157

160-
For `husky` users, add the following configuration to the project's `package.json`:
158+
For `husky` users, add the following configuration to the project's `package.json` file:
161159

162160
```json
163161
"husky": {
@@ -169,19 +167,19 @@ For `husky` users, add the following configuration to the project's `package.jso
169167

170168
> **Why `exec < /dev/tty`?** By default, git hooks are not interactive. This command allows the user to use their terminal to interact with Commitizen during the hook.
171169
172-
#### Congratulations your repo is Commitizen-friendly. Time to flaunt it!
170+
#### Congratulations! Your repo is Commitizen friendly. Time to flaunt it!
173171

174-
Add the Commitizen-friendly badge to your README using the following markdown:
172+
Add the "Commitizen friendly" badge to your README using the following markdown:
175173

176174
```
177175
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
178176
```
179177

180178
Your badge will look like this:
181179

182-
[![Commitizen-friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
180+
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
183181

184-
It may also make sense to change your README.md or CONTRIBUTING.md to include or link to the Commitizen project so that your new contributors may learn more about installing and using Commitizen.
182+
It may also make sense to change your `README.md` or `CONTRIBUTING.md` files to include or link to the Commitizen project so that your new contributors may learn more about installing and using Commitizen.
185183

186184
## Conventional commit messages as a global utility
187185

@@ -191,30 +189,29 @@ Install `commitizen` globally, if you have not already.
191189
npm install -g commitizen
192190
```
193191

194-
Install your preferred `commitizen` adapter globally, for example [`cz-conventional-changelog`](https://www.npmjs.com/package/cz-conventional-changelog)
192+
Install your preferred `commitizen` adapter globally (for example [`cz-conventional-changelog`](https://www.npmjs.com/package/cz-conventional-changelog)).
195193

196194
```sh
197195
npm install -g cz-conventional-changelog
198196
```
199197

200-
Create a `.czrc` file in your `home` directory, with `path` referring to the preferred, globally installed, `commitizen` adapter
198+
Create a `.czrc` file in your `home` directory, with `path` referring to the preferred, globally-installed, `commitizen` adapter
201199

202200
```sh
203201
echo '{ "path": "cz-conventional-changelog" }' > ~/.czrc
204202
```
205203

206-
You are all set! Now `cd`into any `git` repository and use `git cz` instead of `git commit` and you will find the `commitizen` prompt.
204+
You are all set! Now `cd` into any `git` repository and use `git cz` instead of `git commit`, and you will find the `commitizen` prompt.
207205

208-
Protip: You can use all the `git commit` `options` with `git cz`, for example: `git cz -a`.
206+
Pro tip: You can use all the `git commit` `options` with `git cz`. For example: `git cz -a`.
209207

210-
> If your repository is a [nodejs](https://nodejs.org/en/) project, making it [Commitizen-friendly] is super easy.
208+
> If your repository is a [Node.js](https://nodejs.org/en/) project, making it [Commitizen friendly](#making-your-repo-commitizen-friendly) is super easy.
211209
212-
If your repository is already [Commitizen-friendly], the local `commitizen` adapter will be used, instead of globally installed one.
210+
If your repository is already [Commitizen friendly](#making-your-repo-commitizen-friendly), the local `commitizen` adapter will be used, instead of globally installed one.
213211

214212
## Commitizen for multi-repo projects
215213

216-
As a project maintainer of many projects, you may want to standardize on a single commit message
217-
format for all of them. You can create your own node module which acts as front-end for commitizen.
214+
As a project maintainer of many projects, you may want to standardize on a single commit message format for all of them. You can create your own node module which acts as a front-end for Commitizen.
218215

219216
### 1. Create your own entry point script
220217

@@ -236,7 +233,7 @@ bootstrap({
236233
});
237234
```
238235

239-
### 2. Add script to package.json
236+
### 2. Add the script to your `package.json` file
240237

241238
```json
242239
// package.json
@@ -261,7 +258,7 @@ npm install --save-dev company-commit
261258

262259
## Adapters
263260

264-
We know that every project and build process has different requirements so we've tried to keep Commitizen open for extension. You can do this by choosing from any of the pre-build adapters or even by building your own. Here are some of the great adapters available to you:
261+
We know that every project and build process has different requirements, so we've tried to keep Commitizen open for extension. You can do this by choosing from any of the pre-built adapters or even by building your own. Here are some of the great adapters available to you:
265262

266263
- [cz-conventional-changelog](https://www.npmjs.com/package/cz-conventional-changelog)
267264
- [cz-conventional-changelog-for-jira](https://www.npmjs.com/package/@digitalroute/cz-conventional-changelog-for-jira)
@@ -281,18 +278,18 @@ We know that every project and build process has different requirements so we've
281278
- [cz-format-extension](https://github.com/tyankatsu0105/cz-format-extension)
282279
- [cz-emoji-conventional](https://www.npmjs.com/package/cz-emoji-conventional)
283280

284-
To create an adapter, just fork one of these great adapters and modify it to suit your needs. We pass you an instance of [Inquirer.js](https://github.com/SBoudrias/Inquirer.js/) but you can capture input using whatever means necessary. Just call the `commit` callback with a string and we'll be happy. Publish it to npm, and you'll be all set!
281+
To create an adapter, just fork one of these great adapters and modify it to suit your needs. We pass you an instance of [Inquirer.js](https://github.com/SBoudrias/Inquirer.js/), but you can capture input using whatever means necessary. Just call the `commit` callback with a string and we'll be happy. Publish it to npm, and you'll be all set!
285282

286283
## Retrying failed commits
287284

288285
As of version 2.7.1, you may attempt to retry the last commit using the `git cz --retry` command. This can be helpful when you have tests set up to run via a git precommit hook. In this scenario, you may have attempted a Commitizen commit, painstakingly filled out all of the commitizen fields, but your tests fail. In previous Commitizen versions, after fixing your tests, you would be forced to fill out all of the fields again. Enter the retry command. Commitizen will retry the last commit that you attempted in this repo without you needing to fill out the fields again.
289286

290-
Please note that the retry cache may be cleared when upgrading commitizen versions, upgrading adapters, or if you delete the `commitizen.json` file in your home or temp directory. Additionally, the commit cache uses the filesystem path of the repo, so if you move a repo or change its path, you will not be able to retry a commit. This is an edge case, but might be confusing if you have scenarios where you are moving folders that contain repos.
287+
Please note that the retry cache may be cleared when upgrading Commitizen versions, upgrading adapters, or if you delete the `commitizen.json` file in your home or temp directory. Additionally, the commit cache uses the filesystem path of the repo, so if you move a repo or change its path, you will not be able to retry a commit. This is an edge case but might be confusing if you have scenarios where you are moving folders that contain repos.
291288

292-
It is important to note that if you are running `cz` from a npm script (let's say it is called `commit`) you will need to do one of the following:
289+
It is important to note that if you are running `cz` from an npm script (let's say it is called `commit`) you will need to do one of the following:
293290

294291
- Pass `-- --retry` as an argument for your script. i.e: `npm run commit -- --retry`
295-
- Use [npx](https://www.npmjs.com/package/npx) to find and call `cz` executable directly. i.e: `npx cz --retry`
292+
- Use [npx](https://www.npmjs.com/package/npx) to find and call the `cz` executable directly. i.e: `npx cz --retry`
296293

297294
Note that the last two options **do not** require you to pass `--` before the args but the first **does**.
298295

@@ -302,7 +299,7 @@ As a project maintainer, making your repo Commitizen friendly allows you to sele
302299

303300
## Go further
304301

305-
Commitizen is great on its own, but it shines when you use it with some other amazing open source tools. Kent C. Dodds shows you how to accomplish this in his Egghead.io series, [How to write an open source javascript library](https://egghead.io/series/how-to-write-an-open-source-javascript-library). Many of the concepts can be applied to non-javascript projects as well.
302+
Commitizen is great on its own, but it shines when you use it with some other amazing open source tools. Kent C. Dodds shows you how to accomplish this in his Egghead.io series, [How to write an open source javascript library](https://egghead.io/series/how-to-write-an-open-source-javascript-library). Many of the concepts can be applied to non-JavaScript projects as well.
306303

307304
## Philosophy
308305

0 commit comments

Comments
 (0)