Browse Source

Mention pre-commit in README (#87)

pull/88/head
Fredrik Ekre 1 year ago committed by GitHub
parent
commit
45c471bfe0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 22
      README.md

22
README.md

@ -231,10 +231,24 @@ See [`fredrikekre/runic-action`](https://github.com/fredrikekre/runic-action) fo
### Git hooks ### Git hooks
Runic can be run in a Runic can be used together with [`pre-commit`](https://pre-commit.com/) using
[Git pre-commit hook](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks) [`fredrikekre/runic-pre-commit`](https://github.com/fredrikekre/runic-pre-commit). After
to automatically check formatting before committing. Here is an example hook installing `pre-commit` you can add the following to your `.pre-commit-config.yaml` to run
(`.git/hooks/pre-commit`): Runic before each commit:
```yaml
repos:
- repo: https://github.com/fredrikekre/runic-pre-commit
rev: v1.0.0
hooks:
- id: runic
```
See [`fredrikekre/runic-pre-commit`](https://github.com/fredrikekre/runic-pre-commit) for
details.
If you don't want to use `pre-commit` you can also use a plain git hook. Here is an example
hook (`.git/hooks/pre-commit`):
```sh ```sh
#!/usr/bin/env bash #!/usr/bin/env bash

Loading…
Cancel
Save