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

View file

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

View file

@ -11,3 +11,13 @@
- id: fmt - id: fmt
- id: cargo-check - 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', '--']
```