Skip to content

Commit 47c128d

Browse files
committed
Add make rustfmt target.
This is intended to be run on occasion to let us take advantage of rustfmt features available only in nightly while not requiring all contributors and CI to use nightly rustfmt. If the output of nightly rustfmt is not accepted by stable rustfmt, then the recipe will intentionally fail. For now, we prefer to detect when the two versions disagree on formatting rather than let nightly and stable rustfmt stomp on each other.
1 parent a3c45de commit 47c128d

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,3 +282,7 @@ force-update-assets: ## As update-assets, but will run git to update the baselin
282282

283283
check-size: ## Run cargo-diet on all crates to see that they are still in bound
284284
./etc/check-package-size.sh
285+
286+
rustfmt: ## run nightly rustfmt for its extra features, but check that it won't upset stable rustfmt
287+
cargo +nightly fmt --all -- --config-path rustfmt-nightly.toml
288+
cargo +stable fmt --all -- --check

rustfmt-nightly.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
group_imports = "StdExternalCrate"
2+
imports_granularity = "Crate"
3+
max_width = 120

0 commit comments

Comments
 (0)