Cadair / pre-commit-rust

Rust hooks for pre-commit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Notice

This is a fork of the original repo, which as of now, has been unmaintained for a few years. I'm trying to customize the hooks that I use the most, ping at me via the issues board if you needed any change or noticed anything.


Rust hooks for pre-commit

Rust tools package for pre-commit.

Using rust tools with pre-commit

- repo: https://github.com/FeryET/pre-commit-rust
  rev: v1.1.0
  hooks:
    - id: fmt
    - id: cargo-check

Passing arguments to rustfmt

- repo: https://github.com/FeryET/pre-commit-rust
  rev: v1.1.0
  hooks:
    - id: fmt
      args: ["--verbose", "--edition", "2018", "--"]

Pre-push hooks

You can use test and build pre-commit hooks to make sure you are not pushing a faulty code to the remote.

- repo: https://github.com/FeryET/pre-commit-rust
  rev: v1.1.0
  hooks:
    - id: build
    - id: test

You can then install these hooks via:

pre-commit install --hook-type pre-push

About

Rust hooks for pre-commit