From c038893ef883d54b2ad2a7cdc7d1aec828946ced Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Wed, 15 Jan 2025 08:40:21 +0100 Subject: [PATCH 1/4] chore: Add rustfmt.toml --- rustfmt.toml => template/rustfmt.toml | 1 + 1 file changed, 1 insertion(+) rename rustfmt.toml => template/rustfmt.toml (87%) diff --git a/rustfmt.toml b/template/rustfmt.toml similarity index 87% rename from rustfmt.toml rename to template/rustfmt.toml index 6330bc08..e25d3967 100644 --- a/rustfmt.toml +++ b/template/rustfmt.toml @@ -2,3 +2,4 @@ # It's also ok to use the stable toolchain by simple running "cargo fmt", but using the nigthly formatter is prefered. imports_granularity = "Crate" +group_imports = "StdExternalCrate" From 6df48300afa769865869fefd950806dd9cac2e7c Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Wed, 15 Jan 2025 09:03:55 +0100 Subject: [PATCH 2/4] fix: use nightly for cargo fmt --- template/.pre-commit-config.yaml.j2 | 1 + 1 file changed, 1 insertion(+) diff --git a/template/.pre-commit-config.yaml.j2 b/template/.pre-commit-config.yaml.j2 index 3c59d32e..06188847 100644 --- a/template/.pre-commit-config.yaml.j2 +++ b/template/.pre-commit-config.yaml.j2 @@ -18,6 +18,7 @@ repos: rev: eeee35a89e69d5772bdee97db1a6a898467b686e # 1.0 hooks: - id: fmt + entry: cargo +nightly fmt args: ["--all", "--", "--check"] - id: clippy args: ["--all-targets", "--", "-D", "warnings"] From 11dfdccd2d00387907a6ca0ff7f1648008fe17a0 Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Wed, 15 Jan 2025 11:29:02 +0100 Subject: [PATCH 3/4] Use nightly-2025-01-15 toolchain --- template/.pre-commit-config.yaml.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/.pre-commit-config.yaml.j2 b/template/.pre-commit-config.yaml.j2 index 06188847..db603931 100644 --- a/template/.pre-commit-config.yaml.j2 +++ b/template/.pre-commit-config.yaml.j2 @@ -18,7 +18,7 @@ repos: rev: eeee35a89e69d5772bdee97db1a6a898467b686e # 1.0 hooks: - id: fmt - entry: cargo +nightly fmt + entry: RUSTUP_TOOLCHAIN=nightly-2025-01-15 cargo fmt args: ["--all", "--", "--check"] - id: clippy args: ["--all-targets", "--", "-D", "warnings"] From 178ff6ba735391f4e72c70ec54ce60be215df313 Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Wed, 15 Jan 2025 11:30:48 +0100 Subject: [PATCH 4/4] Add comment --- template/.pre-commit-config.yaml.j2 | 1 + 1 file changed, 1 insertion(+) diff --git a/template/.pre-commit-config.yaml.j2 b/template/.pre-commit-config.yaml.j2 index db603931..a36fdcb7 100644 --- a/template/.pre-commit-config.yaml.j2 +++ b/template/.pre-commit-config.yaml.j2 @@ -18,6 +18,7 @@ repos: rev: eeee35a89e69d5772bdee97db1a6a898467b686e # 1.0 hooks: - id: fmt + # Pinning to a specific rustc version, so that we get consistent formatting entry: RUSTUP_TOOLCHAIN=nightly-2025-01-15 cargo fmt args: ["--all", "--", "--check"] - id: clippy