Skip to content

Commit a3f26c3

Browse files
committed
Add hk to README
To explain to new developers the linting tool we use, how to install it and how to use it.
1 parent 8ac749a commit a3f26c3

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

README.md

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,8 @@ This is a service used within the NHS for managing and recording school-aged vac
1313
| [Training](https://github.com/nhsuk/manage-vaccinations-in-schools/deployments/training) | [training.manage-vaccinations-in-schools.nhs.uk](https://training.manage-vaccinations-in-schools.nhs.uk) | External training || `release` branch | manual | [`staging`](config/environments/staging.rb) |
1414
| [Production](https://github.com/nhsuk/manage-vaccinations-in-schools/deployments/production) | [www.manage-vaccinations-in-schools.nhs.uk](https://www.manage-vaccinations-in-schools.nhs.uk) | Live service || `release` branch | manual | [`production`](config/environments/production.rb) |
1515

16-
## Releasing
17-
18-
See the [releasing documentation](docs/releasing.md) for more information.
19-
2016
## Development
2117

22-
### Branching strategy
23-
24-
See the [branching strategy documentation](docs/branching.md) for more information.
25-
2618
### Prerequisites
2719

2820
This project depends on:
@@ -99,12 +91,26 @@ To run the project locally:
9991
bin/setup
10092
```
10193

94+
### Branching strategy
95+
96+
See the [branching strategy documentation](docs/branching.md) for more information.
97+
10298
### Linting
10399

104-
To run the linters:
100+
The linters are configured to run using [`hk`](https://hk.jdx.dev/) which is a tool for running hooks in a Git repository.
101+
102+
If using `mise` this should have already been installed as it's listed in `.tool-versions`, but it can be installed manually by running:
105103

106104
```shell
107-
bin/lint
105+
mise use hk pkl
106+
```
107+
108+
To run the linters you can use `hk check` and `hk fix` to check and fix any linting issues respectively. Alternatively `bin/lint` is provided as a way of running the linters without needing to know about `hk`.
109+
110+
`hk` allows for the linters to be installed as Git hook, ensuring they are run on each commit. This can be configured by running:
111+
112+
```shell
113+
hk install
108114
```
109115

110116
### Intellisense
@@ -315,6 +321,10 @@ automatically be added to the JWKS generated for `/oidc/jwks`, but the old
315321
public key can also be added to `JWKSController::EXTRA_JWK` to ensure a smooth
316322
roll-over.
317323

324+
## Releasing
325+
326+
See the [releasing documentation](docs/releasing.md) for more information.
327+
318328
## Rake tasks
319329

320330
- `access_log:for_patient[id]`

0 commit comments

Comments
 (0)