about summary refs log tree commit diff
path: root/rustfmt.toml
AgeCommit message (Collapse)AuthorLines
2025-07-22Rename `tests/codegen` into `tests/codegen-llvm`Guillaume Gomez-2/+2
2025-05-18Do not run `rustfmt` on the `compiler-builtins` subtreeTrevor Gross-0/+1
This will get checked in the compiler-builtins repository. The rules are slightly different from rust-lang/rust since `use_small_heuristics = "Max"` tends to create difficult to read output with math-heavy code (e.g. multiple `if` statements with numbers are small enough that they sometimes get collapsed into a single line).
2025-05-04Initial support for dynamically linked cratesBryanskiy-0/+1
2025-04-07rustfmt does not support use closures yetSantiago Pastorino-0/+4
2025-04-01Allow formatting example/gen_block_iterate.rsbjorn3-1/+0
2024-12-17Use field init shorthand where possibleJosh Triplett-0/+1
Field init shorthand allows writing initializers like `tcx: tcx` as `tcx`. The compiler already uses it extensively. Fix the last few places where it isn't yet used.
2024-11-02chore(style): sync submodule exclusion list between tidy and rustfmtismailarilik-2/+1
As asked in the FIXME comments
2024-09-22Use style_edition over versionMichael Goulet-1/+1
2024-09-06Remove `src/gcc` from `rustfmt` checksGuillaume Gomez-0/+1
2024-07-30Auto merge of #128083 - Mark-Simulacrum:bump-bootstrap, r=albertlarsan68bors-2/+0
Bump bootstrap compiler to new beta https://forge.rust-lang.org/release/process.html#master-bootstrap-update-t-2-day-tuesday
2024-07-29Update `use` declarations formatting options.Nicholas Nethercote-0/+2
As decided in rust-lang/compiler-team#750. Use declarations are currently wildly inconsistent because rustfmt is quite unopinionated about how they should be formatted. The `rustfmt.toml` additions makes rustfmt more opinionated, which avoids the need for any decision when adding new use declarations to a file. This commit only updates `rustfmt.toml` and `compiler/rustc_codegen_cranelift/rustfmt.toml`. The next commit will do the reformatting.
2024-07-28step cfg(bootstrap)Mark Rousskov-2/+0
2024-07-17Ignore files in cg_gcc example folderGuillaume Gomez-0/+1
2024-07-17Unignore cg_gcc fmtGuillaume Gomez-1/+3
2024-07-12Add rustdoc-json support for use<>Michael Goulet-0/+2
2024-06-04Explain why `tests/ui-fulldeps/` is unformatted.Nicholas Nethercote-1/+1
2024-06-04Explain why `tests/ui/` is unformatted.Nicholas Nethercote-1/+1
2024-06-04Explain why `tests/rustdoc-ui/` is unformatted.Nicholas Nethercote-1/+1
2024-06-04rustfmt `tests/rustdoc-js-std/`.Nicholas Nethercote-1/+0
This is trivial, because the directory contains no `.rs` files.
2024-06-04rustfmt `tests/rustdoc-json/`.Nicholas Nethercote-1/+0
2024-06-04rustfmt `tests/rustdoc-js/`.Nicholas Nethercote-1/+0
2024-06-04Explain why `tests/rustdoc-gui/` is unformatted.Nicholas Nethercote-1/+1
2024-06-04Explain why `tests/rustdoc/` is unformatted.Nicholas Nethercote-1/+1
2024-06-04rustfmt `tests/run-pass-valgrind/`.Nicholas Nethercote-1/+0
2024-06-04rustfmt `tests/run-make-fulldeps/`.Nicholas Nethercote-1/+0
Note: I inserted blank lines between the items in `pretty-expanded/input.rs` because it looked better that way.
2024-06-04Explain why `tests/pretty/` is unformatted.Nicholas Nethercote-1/+1
2024-06-03rustfmt `tests/mir-opt`.Nicholas Nethercote-9/+5
The only non-obvious changes: - `building/storage_live_dead_in_statics.rs` has a `#[rustfmt::skip]` attribute to avoid reformating a table of data. - Two `.mir` files have slight changes involving line numbers. - In `unusual_item_types.rs` an `EMIT_MIR` annotation is moved to outside a function, which is the usual spot, because `tidy` complains if such a comment is indented. The commit also tweaks the comments in `rustfmt.toml`.
2024-05-31Explain why we don't run rustfmt on `tests/incremental/`.Nicholas Nethercote-1/+1
2024-05-31Explain why we don't run rustfmt on `tests/debuginfo/`.Nicholas Nethercote-1/+1
2024-05-31Run rustfmt on `tests/run-make/`.Nicholas Nethercote-1/+1
With the exception of `tests/run-make/translation/test.rs`, which has a syntax error. The expected output in `rustdoc-error-lines/rmake.rs`'s required slight tweaking. The two `reproducible-build.rs` files need `// ignore-tidy-linelength` because rustfmt produces lines longer than 100 chars, which tidy doesn't like, yuk.
2024-05-31Explain why we don't run rustfmt on `tests/crashes/`.Nicholas Nethercote-1/+1
2024-05-31Run rustfmt on `tests/coverage-run-rustdoc/`.Nicholas Nethercote-1/+0
There are only two tiny Rust files in this directory, and they are already formatted correctly.
2024-05-31Run rustfmt on `tests/coverage/`.Nicholas Nethercote-1/+0
There are no changes to `.rs` files because #125693 recently formatted them all.
2024-05-31Run rustfmt on `tests/codegen-units/`.Nicholas Nethercote-1/+0
2024-05-31Run rustfmt on `tests/codegen/`.Nicholas Nethercote-1/+1
Except for `simd-intrinsic/`, which has a lot of files containing multiple types like `u8x64` which really are better when hand-formatted. There is a surprising amount of two-space indenting in this directory. Non-trivial changes: - `rustfmt::skip` needed in `debug-column.rs` to preserve meaning of the test. - `rustfmt::skip` used in a few places where hand-formatting read more nicely: `enum/enum-match.rs` - Line number adjustments needed for the expected output of `debug-column.rs` and `coroutine-debug.rs`.
2024-05-30Run rustfmt on `tests/auxiliary/`.Nicholas Nethercote-1/+0
That directory doesn't contain any Rust files, so it's a trivial change.
2024-05-30Run rustfmt on `tests/assembly/`.Nicholas Nethercote-1/+0
2024-05-30List all `tests/` subdirs explicitly in `rustfmt.toml`.Nicholas Nethercote-3/+26
So we can gradually remove the ones where rustfmt can be used.
2024-05-28Don't format `tests/run-make/*/rmake.rs`.Nicholas Nethercote-8/+2
It's reasonable to want to, but in the current implementation this causes multiple problems. - All the `rmake.rs` files are formatted every time even when they haven't changed. This is because they get whitelisted unconditionally in the `OverrideBuilder`, before the changed files get added. - The way `OverrideBuilder` works, if any files gets whitelisted then no unmentioned files will get traversed. This is surprising, and means that the `rmake.rs` entries broke the use of explicit paths to `x fmt`, and also broke `GITHUB_ACTIONS=true git check --fmt`. The commit removes the `rmake.rs` entries, fixes the formatting of a couple of files that were misformatted (not previously caught due to the `GITHUB_ACTIONS` breakage), and bans `!`-prefixed entries in `rustfmt.toml` because they cause all these problems.
2024-05-28Fix comments.Nicholas Nethercote-7/+7
Some are too long, some aren't complete sentences, some are complete sentences but don't bother with an upper case letter at the start. All annoying and hurt readability.
2024-05-28Remove out-of-date comment.Nicholas Nethercote-1/+0
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.
2024-05-20refactor: add rustc-perf submodule to src/toolsBernardo Meurer Costa-0/+1
Currently, it's very challenging to perform a sandboxed `opt-dist` bootstrap because the tool requires `rustc-perf` to be present, but there is no proper management/tracking of it. Instead, a specific commit is hardcoded where it is needed, and a non-checksummed zip is fetched ad-hoc. This happens in two places: `src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile`: ```dockerfile ENV PERF_COMMIT 4f313add609f43e928e98132358e8426ed3969ae RUN curl -LS -o perf.zip https://ci-mirrors.rust-lang.org/rustc/rustc-perf-$PERF_COMMIT.zip && \ unzip perf.zip && \ mv rustc-perf-$PERF_COMMIT rustc-perf && \ rm perf.zip ``` `src/tools/opt-dist/src/main.rs` ```rust // FIXME: add some mechanism for synchronization of this commit SHA with // Linux (which builds rustc-perf in a Dockerfile) // rustc-perf version from 2023-10-22 const PERF_COMMIT: &str = "4f313add609f43e928e98132358e8426ed3969ae"; let url = format!("https://ci-mirrors.rust-lang.org/rustc/rustc-perf-{PERF_COMMIT}.zip"); let client = reqwest::blocking::Client::builder() .timeout(Duration::from_secs(60 * 2)) .connect_timeout(Duration::from_secs(60 * 2)) .build()?; let response = retry_action( || Ok(client.get(&url).send()?.error_for_status()?.bytes()?.to_vec()), "Download rustc-perf archive", 5, )?; ``` This causes a few issues: 1. Maintainers need to be careful to bump PERF_COMMIT in both places every time 2. In order to run `opt-dist` in a sandbox, you need to provide your own `rustc-perf` (https://github.com/rust-lang/rust/pull/125125), but to figure out which commit to provide you need to grep the Dockerfile 3. Even if you manage to provide the correct `rustc-perf`, its dependencies are not included in the `vendor/` dir created during `dist`, so it will fail to build from the published source tarballs 4. It is hard to provide any level of automation around updating the `rustc-perf` in use, leading to staleness Fundamentally, this means `rustc-src` tarballs no longer contain everything you need to bootstrap Rust, and packagers hoping to leverage `opt-dist` need to go out of their way to keep track of this "hidden" dependency on `rustc-perf`. This change adds rustc-perf as a git submodule, pinned to the current `PERF_COMMIT` 4f313add609f43e928e98132358e8426ed3969ae. Subsequent commits ensure the submodule is initialized when necessary, and make use of it in `opt-dist`.
2024-05-04Fix ignored tests for formattingUrgau-0/+6
2024-05-03Allow `fmt` to run on `rmake.rs` test filesGuillaume Gomez-1/+1
2024-03-08Remove exception for deleted file from rustfmt.tomlbjorn3-1/+0
2024-01-11rustfmt.toml: don't ignore just any `tests` path, only root oneklensy-1/+1
2023-11-23Fix fn_sig_for_fn_abi and the coroutine transform for generatorsbjorn3-0/+1
There were three issues previously: * The self argument was pinned, despite Iterator::next taking an unpinned mutable reference. * A resume argument was passed, despite Iterator::next not having one. * The return value was CoroutineState<Item, ()> rather than Option<Item> While these things just so happened to work with the LLVM backend, cg_clif does much stricter checks when trying to assign a value to a place. In addition it can't handle the mismatch between the amount of arguments specified by the FnAbi and the FnSig.
2023-07-04rust-installer and rls no longer submodule, so fix rustfmt.tomlklensy-2/+2
2023-06-19Format the examples directory of cg_clifbjorn3-1/+0
Formatting has been enforced in cg_clif's CI for a while now.
2023-01-11Change `src/test` to `tests` in source files, fix tidy and testsAlbert Larsan-1/+1