Skip to content

Commit

Permalink
Add automatic formatting via pre-commit hooks (#179)
Browse files Browse the repository at this point in the history
* Adding automatic formatting.

* Add group_imports.
  • Loading branch information
dbittman authored Apr 19, 2024
1 parent 662afce commit 79f81e4
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-added-large-files
- repo: local
hooks:
- id: fmt
name: fmt
entry: bash -c "cargo fmt --all"
language: system
types: [rust]
args: [""]
8 changes: 8 additions & 0 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
edition = "2021"
use_field_init_shorthand = true
newline_style = "Unix"
comment_width = 100
format_code_in_doc_comments = true
imports_granularity = "Crate"
wrap_comments = true
group_imports = "StdExternalCrate"

0 comments on commit 79f81e4

Please sign in to comment.