Merge pull request #9 from DanielChabrowski/format-arguments

Allow passing fmt arguments
This commit is contained in:
Fadi Hadzh 2020-07-05 07:59:53 +03:00 committed by GitHub
commit 2c7d026203
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 5 deletions

View file

@ -1,6 +1,6 @@
repos:
- repo: git://github.com/pre-commit/pre-commit-hooks
rev: v1.4.0
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.1.0
hooks:
- id: check-byte-order-marker
- id: check-case-conflict
@ -11,6 +11,6 @@ repos:
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/pre-commit/pre-commit
rev: v1.10.4
rev: v2.5.1
hooks:
- id: validate_manifest

View file

@ -1,10 +1,10 @@
- id: fmt
name: fmt
description: Format files with cargo fmt.
entry: cargo fmt --
entry: cargo fmt
language: system
types: [rust]
args: []
args: ['--']
- id: cargo-check
name: cargo check
description: Check the package for errors.

View file

@ -11,3 +11,13 @@
- id: fmt
- id: cargo-check
```
## Passing arguments to rustfmt
```yaml
- repo: https://github.com/doublify/pre-commit-rust
rev: master
hooks:
- id: fmt
args: ['--verbose', '--edition', '2018', '--']
```