Skip to content

Commit b8868ba

Browse files
committed
Update settings documentation
1 parent 88b32cd commit b8868ba

File tree

1 file changed

+63
-26
lines changed

1 file changed

+63
-26
lines changed

configure.html

Lines changed: 63 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ <h4>CLI commands</h4>
110110
breaks any unit test.
111111
</p>
112112

113-
<h5>Placeholders</h5>
113+
<h5 id="placeholder">Placeholders</h5>
114114
<p>
115115
You can use placeholders in CLI actions that will get replaced by the Cap'n before execution. This way you can
116116
access the original hook arguments and some other neat stuff.
@@ -127,7 +127,6 @@ <h5>Placeholders</h5>
127127
}
128128
}</code></pre>
129129

130-
<h5 id="placeholder">Placeholders</h5>
131130
<p>
132131
Action placeholders work like this:
133132
<pre>{$ PLACEHOLDER | OPTION : ARGUMENT }</pre>
@@ -418,24 +417,24 @@ <h2>Settings</h2>
418417
</p>
419418
<pre><code class="javascript">{
420419
"config": {
420+
"ansi-colors": false,
421421
"bootstrap": "../vendor/autoload.php",
422-
"git-directory": "../../.git",
422+
"custom": {
423+
"my-custom-index": "my-custom-value"
424+
},
423425
"fail-on-first-error": false,
424-
"verbosity": "verbose",
425-
"ansi-colors": false,
426-
"includes-level": 2,
426+
"git-directory": "../../.git",
427427
"includes": [],
428+
"includes-level": 2,
428429
"plugins": [],
429430
"php-path": "/usr/bin/php7.4",
430-
"custom": {
431-
"my-custom-index": "my-custom-value"
432-
},
433431
"run": {
434432
"mode": "docker",
435433
"exec": "docker exec -i CONTAINER_NAME",
436434
"path": "vendor/bin/captainhook",
437435
"git": "/docker/.git"
438-
}
436+
},
437+
"verbosity": "verbose"
439438
}
440439
}</code></pre>
441440

@@ -445,30 +444,30 @@ <h2>Settings</h2>
445444
<th>Description</th>
446445
<th>Default</th>
447446
</tr>
447+
<tr>
448+
<td>ansi-colors</td>
449+
<td>Enable or disable ANSI color output</td>
450+
<td>true</td>
451+
</tr>
448452
<tr>
449453
<td>bootstrap</td>
450454
<td>Path to your bootstrap / autoloader file.</td>
451455
<td>vendor/autoload.php</td>
452456
</tr>
453457
<tr>
454-
<td>git-directory</td>
455-
<td>Custom path to your repositories .git directory (relative from the configuration file)</td>
456-
<td>.git</td>
458+
<td>custom</td>
459+
<td>List of custom settings you need for replacements or custom actions</td>
460+
<td>-</td>
457461
</tr>
458462
<tr>
459463
<td>fail-on-first-error</td>
460-
<td>Stop hook execution on first error (true) or execute all actions and collect all errors (false)</td>
464+
<td>Stop hook execution on first error (<code>true</code>) or execute all actions and collect all errors (<code>false</code>)</td>
461465
<td>true</td>
462466
</tr>
463467
<tr>
464-
<td>verbosity</td>
465-
<td>Define the output verbosity [quiet|normal|verbose|debug]</td>
466-
<td>verbose</td>
467-
</tr>
468-
<tr>
469-
<td>ansi-colors</td>
470-
<td>Enable or disable ANSI color output</td>
471-
<td>true</td>
468+
<td>git-directory</td>
469+
<td>Custom path to your repositories .git directory (relative from the configuration file)</td>
470+
<td>.git</td>
472471
</tr>
473472
<tr>
474473
<td>includes</td>
@@ -498,14 +497,14 @@ <h2>Settings</h2>
498497
<td>-</td>
499498
</tr>
500499
<tr>
501-
<td>custom</td>
502-
<td>List of custom settings you need for replacements or custom actions</td>
503-
<td>-</td>
500+
<td>verbosity</td>
501+
<td>Define the output verbosity (<code>quiet</code>|<code>normal</code>|<code>verbose</code>|<code>debug</code>)</td>
502+
<td>verbose</td>
504503
</tr>
505504
<tr><td colspan="3"><strong>Run Configuration</strong></td></tr>
506505
<tr>
507506
<td>mode</td>
508-
<td>CaptainHook execution mode (shell|php|local|docker)</td>
507+
<td>CaptainHook execution mode (<code>shell</code>|<code>php</code>|<code>local</code>|<code>docker</code>)</td>
509508
<td>shell</td>
510509
</tr>
511510
<tr>
@@ -557,6 +556,44 @@ <h3>Overwrite settings</h3>
557556
<strong>ATTENTION:</strong> Remember to exclude the file from version control ;)
558557
</p>
559558

559+
<a id="settings-action"></a>
560+
<h3>Action settings</h3>
561+
<p>
562+
You can also configure settings for a specific action.
563+
</p>
564+
<pre><code class="javascript">{
565+
"pre-commit": {
566+
"enabled": true,
567+
"actions": [
568+
{
569+
"action": "tools/phpunit.phar --configuration=phpunit.git.xml",
570+
"config": {
571+
"allow-failure": true,
572+
"label": "Unit tests"
573+
}
574+
}
575+
]
576+
}
577+
}</code></pre>
578+
579+
<table class="table">
580+
<tr>
581+
<th style="width:120px">Setting</th>
582+
<th>Description</th>
583+
<th>Default</th>
584+
</tr>
585+
<tr>
586+
<td>allow-failure</td>
587+
<td>Indicates if the action can fail without stopping the git operation</td>
588+
<td>false</td>
589+
</tr>
590+
<tr>
591+
<td>label</td>
592+
<td>The label to display when the action is executed</td>
593+
<td>The value of <code>action</code></td>
594+
</tr>
595+
</table>
596+
560597
</div>
561598

562599
<footer class="footer">

0 commit comments

Comments
 (0)