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

feat: add non-nix pre-commit rustfmt and clippy hooks #986

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
15 changes: 15 additions & 0 deletions .pre-commit-config-non-nix.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
repos:
- repo: local
hooks:
- id: rust-linting
name: Rust linting
description: Run rustfmt on included files
entry: cargo fmt --
types: [file, rust]
language: system
- id: rust-clippy
name: Rust clippy
description: Run clippy on included files
entry: cargo clippy --workspace --all-targets --all-features --
types: [file, rust]
language: system
5 changes: 5 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ Some useful commands include:
pre-commit-hooks.nix
- `just itest`: runs integration tests

**For non-nix users,**
There are traditional `pre-commit` hooks, which you can install with your system package manager or
`brew|pip install pre-commit`, and run `pre-commit install -c .pre-commit-config-non-nix.yaml` in the root of the repository.
Then these hooks will run automatically when you commit.

The [just](https://github.com/casey/just) command runner can be used to run some
helpful development commands, in a manner similar to `make`. Run `just --list`
to get an overview of what’s available.
Expand Down