Skip to content

Commit

Permalink
Add rustfmt config
Browse files Browse the repository at this point in the history
  • Loading branch information
uklotzde committed Mar 19, 2023
1 parent 091b0bc commit 9912044
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,20 @@ repos:
hooks:
- id: shellcheck
- repo: https://github.com/codespell-project/codespell
rev: v2.2.2
rev: v2.2.4
hooks:
- id: codespell
args: [--ignore-words=.codespellignore]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.4
rev: v3.0.0-alpha.6
hooks:
- id: prettier
types_or:
- markdown
- yaml
# https://reuse.software
- repo: https://github.com/fsfe/reuse-tool
rev: v1.1.0
rev: v1.1.2
hooks:
- id: reuse
- repo: https://github.com/doublify/pre-commit-rust
Expand Down
25 changes: 25 additions & 0 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# SPDX-FileCopyrightText: slowtec GmbH
# SPDX-License-Identifier: CC0-1.0

# Only add deviations from the default settings!

# Consistently use a single edition for all workspace crates, should match Cargo.toml
edition = "2021"

# <https://github.com/rust-lang/rustfmt/blob/master/Configurations.md#imports_granularity>
imports_granularity = "Crate"

# <https://github.com/rust-lang/rustfmt/blob/master/Configurations.md#group_imports>
group_imports = "StdExternalCrate"

# <https://github.com/rust-lang/rustfmt/blob/master/Configurations.md#use_field_init_shorthand>
use_field_init_shorthand = true

# <https://github.com/rust-lang/rustfmt/blob/master/Configurations.md#use_try_shorthand>
use_try_shorthand = true

# <https://github.com/rust-lang/rustfmt/blob/master/Configurations.md#format_strings>
format_strings = true

# <https://github.com/rust-lang/rustfmt/blob/master/Configurations.md#format_code_in_doc_comments>
format_code_in_doc_comments = true

0 comments on commit 9912044

Please sign in to comment.