Skip to content

Commit

Permalink
[ Task ] Update README.md (#65)
Browse files Browse the repository at this point in the history
* Change code snippet syntax in README

* Add section for automated hook updates in README

* Moved a crucial instruction to a more sensible location

* Update README.md

Co-authored-by: Len Woodward <[email protected]>

---------

Co-authored-by: Len Woodward <[email protected]>
  • Loading branch information
sebastianstucke87 and ProjektGopher authored Sep 25, 2023
1 parent 9893d7a commit 2ee58d0
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ If Whisky is installed both globally, and locally, on a project the version that
## Usage
The `install` command will create a `whisky.json` file in your project root:

```json
```js
// whisky.json
{
"disabled": [],
"hooks": {
Expand All @@ -57,9 +58,25 @@ The `install` command will create a `whisky.json` file in your project root:

For a complete list of supported git hooks, see the [Git Documentation](https://git-scm.com/docs/githooks#_hooks).

> **Warning** all hooks are **evaluated as-is** in the terminal. Keep this in mind when committing anything involving changes to your `whisky.json`.
Adding or removing any **hooks** (_not_ individual commands) to your `whisky.json` file should be followed by `./vendor/bin/whisky update` to ensure that these changes are reflected in your `.git/hooks` directory.

> **Warning** all hooks are **evaluated as-is** in the terminal. Keep this in mind when committing anything involving changes to your `whisky.json`.
### Automating Hook Updates
While we suggest leaving Whisky as an 'opt-in' tool, by adding a couple of Composer scripts we can _ensure_ consistent git hooks for all project contributors. This will **force** everyone on the project to use Whisky:

```js
// composer.json
// ...
"scripts": {
"post-install-cmd": [
"whisky update"
],
"post-update-cmd": [
"whisky update"
]
}
// ...

### Skipping Hooks
Sometimes you need to commit or push changes without running your git hooks,
Expand Down

0 comments on commit 2ee58d0

Please sign in to comment.