X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=rustfmt.toml;h=aa0d4888f082dadf7f889c8b18286f0a14dfe54b;hb=91d5a32bc59c50af762928da5a02b024b36c1891;hp=10d39762043ea0e03b4cb89405c82f2a04661aa8;hpb=59dd179ad3b89c404cae4d251015a510289a048f;p=rust.git diff --git a/rustfmt.toml b/rustfmt.toml index 10d39762043..aa0d4888f08 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -1,7 +1,43 @@ -max_width = 120 -comment_width = 100 -match_block_trailing_comma = true -wrap_comments = true -edition = "2021" -error_on_line_overflow = true +# Run rustfmt with this config (it should be picked up automatically). 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/", + "/*-build/", + "/build-*/", + "/vendor/", + + # tests for now are not formatted, as they are sometimes pretty-printing constrained + # (and generally rustfmt can move around comments in UI-testing incompatible ways) + "src/test", + + # do not format submodules + "library/backtrace", + "library/portable-simd", + "library/stdarch", + "compiler/rustc_codegen_gcc", + "src/doc/book", + "src/doc/edition-guide", + "src/doc/embedded-book", + "src/doc/nomicon", + "src/doc/reference", + "src/doc/rust-by-example", + "src/doc/rustc-dev-guide", + "src/llvm-project", + "src/tools/cargo", + "src/tools/clippy", + "src/tools/miri", + "src/tools/rls", + "src/tools/rust-analyzer", + "src/tools/rustfmt", + "src/tools/rust-installer", + + # these are ignored by a standard cargo fmt run + "compiler/rustc_codegen_cranelift/y.rs", # running rustfmt breaks this file + "compiler/rustc_codegen_cranelift/example", + "compiler/rustc_codegen_cranelift/scripts", +]