blob: d9857a7e3e7887a07803461e7a1f7f67c0d23231 [file] [log] [blame]
Mark Rousskov8eb7c582019-12-22 21:43:541# Run rustfmt with this config (it should be picked up automatically).
Michael Goulet11732042024-09-22 23:05:252style_edition = "2024"
Aleksey Kladovce394612019-05-03 18:35:213use_small_heuristics = "Max"
Mark Rousskov8eb7c582019-12-22 21:43:544merge_derives = false
Nicholas Nethercote118f9352024-06-12 23:16:095group_imports = "StdExternalCrate"
6imports_granularity = "Module"
Josh Tripletta105cd62024-12-17 22:33:107use_field_init_shorthand = true
Adam Perry8369a1a2019-10-29 15:33:118
Nicholas Nethercotef1b0ca02024-05-28 00:03:009# Files to ignore. Each entry uses gitignore syntax, but `!` prefixes aren't allowed.
Adam Perry8369a1a2019-10-29 15:33:1110ignore = [
Mark Rousskovd5b760b2021-01-09 17:00:4511 "/build/",
Rich Kadel79020a82021-04-24 21:12:2212 "/*-build/",
13 "/build-*/",
Eric Huss6575abc2020-02-11 03:08:2414 "/vendor/",
Jonas Schievink08e85aa2020-01-31 16:09:3415
Nicholas Nethercotec9c80d22024-06-03 00:18:3316 # Some tests are not formatted, for various reasons.
Nicholas Nethercote72800d32024-05-29 04:11:2017 "/tests/codegen/simd-intrinsic/", # Many types like `u8x64` are better hand-formatted.
Nicholas Nethercotec9c80d22024-06-03 00:18:3318 "/tests/crashes/", # Many of these tests contain syntax errors.
19 "/tests/debuginfo/", # These tests are somewhat sensitive to source code layout.
20 "/tests/incremental/", # These tests are somewhat sensitive to source code layout.
Nicholas Nethercote5875f3f2024-06-03 05:59:3121 "/tests/pretty/", # These tests are very sensitive to source code layout.
Bryanskiy14535312024-09-30 18:07:3622 "/tests/run-make/export", # These tests contain syntax errors.
Nicholas Nethercotec9c80d22024-06-03 00:18:3323 "/tests/run-make/translation/test.rs", # This test contains syntax errors.
Nicholas Nethercotee372bf82024-06-03 07:30:0924 "/tests/rustdoc/", # Some have syntax errors, some are whitespace-sensitive.
Nicholas Nethercote98d65d62024-06-03 07:34:3925 "/tests/rustdoc-gui/", # Some tests are sensitive to source code layout.
Nicholas Nethercote1be65922024-06-04 00:17:5826 "/tests/rustdoc-ui/", # Some have syntax errors, some are whitespace-sensitive.
Nicholas Nethercote758d49e2024-06-04 00:22:4327 "/tests/ui/", # Some have syntax errors, some are whitespace-sensitive.
Nicholas Nethercoted2ea6922024-06-04 00:27:3028 "/tests/ui-fulldeps/", # Some are whitespace-sensitive (e.g. `// ~ERROR` comments).
Mark Rousskov8eb7c582019-12-22 21:43:5429
Nicholas Nethercote4702a1c2024-05-28 00:36:3730 # Do not format submodules.
Alex Crichton06d565c2020-05-13 21:22:3731 "library/backtrace",
Jubilee Young39cb8632021-10-22 07:12:0032 "library/portable-simd",
mark2c31b452020-06-12 02:31:4933 "library/stdarch",
Adam Perry8369a1a2019-10-29 15:33:1134 "src/doc/book",
35 "src/doc/edition-guide",
36 "src/doc/embedded-book",
37 "src/doc/nomicon",
38 "src/doc/reference",
39 "src/doc/rust-by-example",
Santiago Pastorino4387a8b2020-03-10 20:22:2540 "src/doc/rustc-dev-guide",
Adam Perry8369a1a2019-10-29 15:33:1141 "src/llvm-project",
Adam Perry8369a1a2019-10-29 15:33:1142 "src/tools/cargo",
43 "src/tools/clippy",
ismailarilik4e0d71f2024-11-02 13:43:1044 "src/tools/enzyme",
Adam Perry8369a1a2019-10-29 15:33:1145 "src/tools/miri",
Aleksey Kladov058c1b62020-06-04 11:11:1546 "src/tools/rust-analyzer",
Bernardo Meurer Costae2870442024-05-14 18:47:1547 "src/tools/rustc-perf",
Adam Perry8369a1a2019-10-29 15:33:1148 "src/tools/rustfmt",
Guillaume Gomezca52d302024-07-16 20:13:5049 "src/gcc",
bjorn3bffe8802021-12-30 14:04:4750
Nicholas Nethercote4702a1c2024-05-28 00:36:3751 # These are ignored by a standard cargo fmt run.
bjorn3bffe8802021-12-30 14:04:4752 "compiler/rustc_codegen_cranelift/scripts",
Guillaume Gomeze1852d02024-07-12 12:25:3153 "compiler/rustc_codegen_gcc/tests",
54 # Code automatically generated and included.
55 "compiler/rustc_codegen_gcc/src/intrinsic/archs.rs",
Guillaume Gomez12bedc32024-07-17 18:21:5256 "compiler/rustc_codegen_gcc/example",
Santiago Pastorinodfa58e32025-03-31 17:36:0957
58 # Rustfmt doesn't support use closures yet
59 "tests/mir-opt/ergonomic-clones/closure.rs",
60 "tests/codegen/ergonomic-clones/closure.rs",
Adam Perry8369a1a2019-10-29 15:33:1161]