Skip to content

Commit

Permalink
✨ feat: add pre-commit hook config
Browse files Browse the repository at this point in the history
  • Loading branch information
TribuneX committed Jan 18, 2025
1 parent 5d00fa7 commit 9d454aa
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- id: git-sumi
name: Lint commit message with git sumi
description: Lints each new commit with git sumi based on the configured project rules in your sumi.toml
entry: git-sumi --file
language: rust
pass_filenames: false
stages: [commit-msg]
12 changes: 12 additions & 0 deletions website/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,18 @@ git sumi -c '🎨 refactor: format JS with Prettier'

If your message passes all rules, it will be committed. Otherwise, you'll see what went wrong.

### Using pre-commit

You can also integrate git-**sumi** via [pre-commit](https://pre-commit.com/#intro) by adding the following hook to your pre-commit config:

```yaml
repos:
- repo: https://github.com/welpo/git-sumi
rev: v0.1.0 # check latest version: https://github.com/welpo/git-sumi/tags
hooks:
- id: git-sumi
```
## Contributing
Please do! We appreciate bug reports, improvements to documentation (however minor), feature requests, code contributions… To get started, take a look at the [contributing guidelines](https://github.com/welpo/git-sumi/blob/main/CONTRIBUTING.md).
2 changes: 1 addition & 1 deletion website/docs/integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sidebar_position: 6
## Local linting with Git hooks

:::tip
To set up both Git hooks described below, run `git sumi --init hooks`.
To set up both Git hooks described below, run `git sumi --init hooks`. As an alternative git-**sumi** can be integrated with the [pre-commit package manager](/docs/#using-pre-commit).
:::

### commit-msg hook
Expand Down

0 comments on commit 9d454aa

Please sign in to comment.