rustfmt
rustfmt copied to clipboard
Format Rust code
Tracking issue for unstable option: `imports_granularity`. [Option documentation.](https://rust-lang.github.io/rustfmt/#imports_granularity) See [Processes.md, "Stabilising an Option"](https://github.com/rust-lang/rustfmt/blob/master/Processes.md#stabilising-an-option): - [x] Is the default value correct? - [x] The design and implementation of the option are...
Tracking issue for unstable option: struct_field_align_threshold
This PR adds an unstable `format_brace_macros` option for formatting brace `{}` delimited macro invocations that parse as valid Rust code, with fallback to existing behavior. ## Motivation Users consistently expect...
This code: ```rust let unformatted = { 1} // comment ; ``` or this: ```rust let unformatted = { 1} // comment ; ``` will pass through rustfmt unchanged. Removing...
Hello! Tracking issue: #5435 This feature adds the option to put a space after '(' and before ')' on items surrounded by parentheses (on function/method declarations, calls, ...). Tips on...
rustfmt 1.5.1-nightly (9243168 2022-08-31) rustfmt.toml: ```toml format_macro_matchers = true format_macro_bodies = true format_strings = false ``` code won't format ```rust macro_rules! test { ($( $v:expr ),*) => { $( $v),*...
This pull request adapts the plan 2 of [@ytmimi's comment](https://github.com/rust-lang/rustfmt/issues/5533#issuecomment-1238224735), and it won't touch any comment which is not a documentation comment now. However, it did not fixed the root...
## Meta - **rustfmt version**: `rustfmt 1.5.1-nightly (b44197ab 2022-09-05)` - **Minimum reproducible repo**: - **rustfmt configuration**: ```toml format_code_in_doc_comments = true ``` ## Description After enabling `format_code_in_doc_comments`, rustfmt formats the following...
My config: ```toml unstable_features = true error_on_line_overflow = true error_on_unformatted = true format_code_in_doc_comments = true format_strings = true hex_literal_case = "Lower" imports_granularity = "Crate" normalize_comments = true reorder_impl_items = true...
Fixes #5526 When creating new contexts with `FmtVisitor::get_context` we set the value of `ctx.inside_macro` based on the `parent_context` if it exists. This helps us remember that we're inside of a...