Skip to content

Commit

Permalink
Add make rustfmt target.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
avoidscorn committed Aug 14, 2021
1 parent a3c45de commit 47c128d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -282,3 +282,7 @@ force-update-assets: ## As update-assets, but will run git to update the baselin

check-size: ## Run cargo-diet on all crates to see that they are still in bound
./etc/check-package-size.sh

rustfmt: ## run nightly rustfmt for its extra features, but check that it won't upset stable rustfmt
cargo +nightly fmt --all -- --config-path rustfmt-nightly.toml
cargo +stable fmt --all -- --check
3 changes: 3 additions & 0 deletions rustfmt-nightly.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
group_imports = "StdExternalCrate"
imports_granularity = "Crate"
max_width = 120

0 comments on commit 47c128d

Please sign in to comment.