Skip to content

Commit

Permalink
Mention pre-commit in README
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikekre committed Oct 31, 2024
1 parent 35d6dd4 commit cfc08ea
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,24 @@ See [`fredrikekre/runic-action`](https://github.com/fredrikekre/runic-action) fo
### Git hooks
Runic can be run in a
[Git pre-commit hook](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks)
to automatically check formatting before committing. Here is an example hook
(`.git/hooks/pre-commit`):
Runic can be used together with [`pre-commit`](https://pre-commit.com/) using
[`fredrikekre/runic-pre-commit`](https://github.com/fredrikekre/runic-pre-commit). After
installing `pre-commit` you can add the following to your `.pre-commit-config.yaml` to run
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
#!/usr/bin/env bash
Expand Down

0 comments on commit cfc08ea

Please sign in to comment.