Skip to content

Commit 80d7c81

Browse files
committed
Corrected a few typo in the README
1 parent b4cbe62 commit 80d7c81

File tree

1 file changed

+28
-17
lines changed

1 file changed

+28
-17
lines changed

README.md

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,18 @@ grunt.initConfig({
3333
// Target-specific options go here
3434
},
3535
// Hook definitions go there
36-
'pre-commit': 'jshint',
37-
'post-merge': {
38-
'taskNames': 'bower:install'
39-
}
4036
}
41-
},
4237
},
4338
})
4439
```
4540

4641
#### Defining a few hooks
4742

48-
Hooks are listed as keys of your target configuration. *Any other key than `option`* in your target will be considered the name of a hook you want to create. The simplest way to define a hook is to provide a *space-separated list of the tasks* you want the hook to run as the value*. For example:
43+
Hooks are listed as keys of your target configuration.
44+
**Any key other than `option`** is considered the name of a hook you want to create.
45+
The simplest way to define a hook is to provide a **space-separated list of the tasks you want the hook to run as the value**.
4946

47+
For example:
5048
```js
5149
grunt.initConfig({
5250
githooks: {
@@ -56,12 +54,16 @@ grunt.initConfig({
5654
}
5755
}
5856
});
57+
```
5958

60-
The plugin warns you if the name matches one of the [hooks announced in the Git documentation](https://www.kernel.org/pub/software/scm/git/docs/githooks.html). It will still create the hook, though, in case Git introduces new hooks in the future.
59+
The plugin warns you if the name matches one of the [hooks announced in the Git documentation](https://www.kernel.org/pub/software/scm/git/docs/githooks.html).
60+
It will still create the hook, though, in case Git introduces new hooks in the future.
6161

6262
#### Hook specific options
6363

64-
If you need to override a few options for a given hook only, you can *use and Object instead of a String*. The `taskNames` property will then correspond to the tasks you want to run, and any other key will be merged into the options.
64+
If you need to override a few options for a given hook only, you can *use and Object instead of a String*.
65+
The `taskNames` property will then correspond to the tasks you want to run.
66+
Any other key will be merged into the options.
6567

6668
```js
6769
grunt.initConfig({
@@ -83,10 +85,12 @@ grunt.initConfig({
8385
}
8486
}
8587
})
88+
```
8689

8790
#### Working with existing hooks
8891

89-
If you happen to have existing hooks in your hook folder, the plugin will *append the code running Grunt* at the end of your hooks. You can also insert marker comments in your hooks to specify exactly where you want them inserted.
92+
If you happen to have existing hooks in your hook folder, the plugin *appends the code launching Grunt* at the end of your hooks.
93+
You can also insert marker comments in your hooks to specify exactly where you want them inserted.
9094
Your existing hook would look something like this:
9195

9296
```js
@@ -97,13 +101,15 @@ Your existing hook would look something like this:
97101
// Some code run after Grunt starts
98102
```
99103

100-
The markers get automatically inserted when the plugin appends code, so the hooks get updated cleanly the next time you run `grunt githooks`.
104+
The markers get automatically inserted when the plugin appends code, so hooks get updated cleanly the next time you run `grunt githooks`.
101105

102106
#### Customising hook output
103107

104-
By default, the plugin generate NodeJS scripts for the hooks. Reasonning behind this is that creating Shell scripts won't work well for people using Windows and NodeJS is already installed as Grunt kinda need is. However, you're not tied to it and you can customise pretty much everything.
108+
By default, the plugin generate NodeJS scripts for the hooks.
109+
Reasonning behind this is that creating Shell scripts won't work well for people using Windows.
110+
Plus, NodeJS is already installed as Grunt kinda needs it.
111+
However, you're not tied to it and you can customise the generated script entirely. In case of a Shell script:
105112

106-
So say you want a Shell script rather than the default NodeJS ones:
107113
```js
108114
grunt.initConfig({
109115
githooks: {
@@ -124,7 +130,9 @@ grunt.initConfig({
124130

125131
#### Extending the plugin
126132

127-
Pretty annoying when you're using a library that's missing the exact extension point you need to tweak its functionalities? `grunt-githooks` is based on a lot of small functions and most of them are exposed so you can override them. If you need feel free to tinker with the internals (at your own risk though ;)). Could be something along:
133+
Pretty annoying when you're using a library that's missing the exact extension point you need to tweak its functionalities?
134+
`grunt-githooks` is based on a lot of small functions and most of them are exposed so you can override them.
135+
If you need feel, free to tinker with the internals (at your own risk though ;)). Could be something along:
128136

129137
```js
130138
var gruntGithooks = require('grunt-githooks/tasks/githooks');
@@ -136,7 +144,6 @@ gruntGithooks.internals.Hook.prototype.getHookContent = function () {
136144
};
137145
```
138146

139-
140147
### Options
141148

142149
#### hashbang
@@ -151,7 +158,8 @@ code in it (to avoid inserting Node code in a Python hook for example).
151158
Type: `String`
152159

153160
Path to the Handlebars template used to generate the code that will run Grunt
154-
in the hook. Default template is the `node.js.hb` file located in the `templates` folder of the plugin. It also contains a `shell.hb` file with the template for a shell script hook.
161+
in the hook. Default template is the `node.js.hb` file located in the `templates` folder of the plugin.
162+
It also contains a `shell.hb` file with the template for a shell script hook.
155163

156164
#### startMarker
157165
Type: `String`
@@ -161,13 +169,16 @@ Default: `'// GRUNT-GITHOOKS START'`
161169
Type: `String`
162170
Default: `'// GRUNT-GITHOOKS END'`
163171

164-
`startMarker` and `endMarker` are markers the plugin use to know where to insert code if a hook already exist. If the existing hook doesn't have these markers, the code will simply be appended.
172+
`startMarker` and `endMarker` are markers the plugin use to know where to insert code if a hook already exist.
173+
If the existing hook doesn't have these markers, the code will simply be appended.
165174

166175
#### preventExit
167176
Type: `Boolean`
168177
Default `false`
169178

170-
By default, the inserted code will exit the process after Grunt has run, using a -1 exit code if the task(s) failed. If you're inserting the code running Grunt in the middle of an existing hook, you'll probably want to disable this so any code after what was inserted by the plugin runs.
179+
By default, the inserted code will exit the process after Grunt has run, using a -1 exit code if the task(s) failed.
180+
If you're inserting the code running Grunt in the middle of an existing hook,
181+
you might want to disable this so any code after what was inserted by the plugin runs.
171182

172183
#### dest
173184
Type: `String`

0 commit comments

Comments
 (0)