Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mention pre-commit in README #87

Merged
merged 1 commit into from
Oct 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading