From 8ec5901c72e9df431e636b33bbcf25d1a332cb42 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Thu, 23 May 2024 08:56:38 +1000 Subject: [PATCH 1/2] Fix `tests/run-make` handling. I tried some `rustfmt.toml` changes and these files were changed under `tests/run-make`: tests/run-make/CURRENT_RUSTC_VERSION/rmake.rs tests/run-make/compiler-builtins/rmake.rs tests/run-make/cross-lang-lto-riscv-abi/rmake.rs tests/run-make/issue-26006/in/libc/lib.rs tests/run-make/issue-26006/in/time/lib.rs tests/run-make/print-cfg/rmake.rs tests/run-make/print-native-static-libs/rmake.rs tests/run-make/print-to-output/rmake.rs tests/run-make/rustdoc-scrape-examples-invalid-expr/src/lib.rs tests/run-make/rustdoc-scrape-examples-macros/src/lib.rs tests/run-make/rustdoc-scrape-examples-test/examples/ex.rs tests/run-make/thumb-none-qemu/example/src/main.rs tests/run-make/wasm-exceptions-nostd/src/arena_alloc.rs tests/run-make/wasm-exceptions-nostd/src/lib.rs tests/run-make/wasm-exceptions-nostd/src/panicking.rs tests/run-make/x86_64-fortanix-unknown-sgx-lvi/enclave/build.rs Only the `rmake.rs` files should have been changed. This commit adjust the rules to initially exclude all files under `tests/run-make/`, not just `tests/run-make/*/*.rs`. Because there are some `.rs` files at deeper depths. After that, the changes I get are to only the desired files: tests/run-make/CURRENT_RUSTC_VERSION/rmake.rs tests/run-make/compiler-builtins/rmake.rs tests/run-make/cross-lang-lto-riscv-abi/rmake.rs tests/run-make/print-cfg/rmake.rs tests/run-make/print-native-static-libs/rmake.rs tests/run-make/print-to-output/rmake.rs --- rustfmt.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rustfmt.toml b/rustfmt.toml index ef56059feb1c7..d3ec425de4666 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -18,7 +18,7 @@ ignore = [ # but we still want to format rmake.rs files in tests/run-make/ so we need to do this # dance to avoid the parent directory from being excluded "!/tests/run-make/", - "/tests/run-make/*/*.rs", + "/tests/run-make/*", "!/tests/run-make/*/rmake.rs", # do not format submodules From 481965a8258a6bff7ff6183821763b31cf91ae09 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Thu, 23 May 2024 09:12:19 +1000 Subject: [PATCH 2/2] Remove out-of-date comment. This comment -- "by default we ignore everything in the repository" -- was added in #65939 when rustfmt was first being introduced for this repository and (briefly) every directory was ignored. Since then lots of directories have opted in to formatting, so it is no longer true. --- rustfmt.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/rustfmt.toml b/rustfmt.toml index d3ec425de4666..1643139cc2d74 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -3,7 +3,6 @@ version = "Two" use_small_heuristics = "Max" merge_derives = false -# by default we ignore everything in the repository # tidy only checks files which are not ignored, each entry follows gitignore style ignore = [ "/build/",