From c29848d739f7e2d48e066a0917bdf00c8af41b35 Mon Sep 17 00:00:00 2001 From: Lukas Kalbertodt Date: Wed, 18 Mar 2020 22:55:45 +0100 Subject: [PATCH] Change default value for `blank_lines_upper_bound` from 1 to 5 --- CHANGELOG.md | 9 ++++++--- Configurations.md | 4 ++-- rustfmt-core/rustfmt-config/src/lib.rs | 4 ++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 416203b823a..773bd375e02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## [Unreleased] +### Changed +- Change the default value for `blank_lines_upper_bound` from 1 to 5. + ## [1.4.9] 2019-10-07 ### Changed @@ -13,7 +16,7 @@ - Fix aligning comments of different group - Fix flattening imports with a single `self`. - Fix removing attributes on function parameters. -- Fix removing `impl` keyword from opaque type. +- Fix removing `impl` keyword from opaque type. ## [1.4.8] 2019-09-08 @@ -45,7 +48,7 @@ - Add `--message-format` command line option to `cargo-fmt`. - Add `-l,--files-with-diff` command line option to `rustfmt`. -- Add `json` emit mode. +- Add `json` emit mode. ### Fixed @@ -96,7 +99,7 @@ ### Added -- Add new attribute `rustfmt::skip::attributes` to prevent rustfmt +- Add new attribute `rustfmt::skip::attributes` to prevent rustfmt from formatting an attribute #3665 ### Changed diff --git a/Configurations.md b/Configurations.md index 6de10eaabf0..e10105fdd45 100644 --- a/Configurations.md +++ b/Configurations.md @@ -103,7 +103,7 @@ fn bar() { Maximum number of blank lines which can be put between items. If more than this number of consecutive empty lines are found, they are trimmed down to match this integer. -- **Default value**: `1` +- **Default value**: `5` - **Possible values**: any non-negative integer - **Stable**: No (tracking issue: #3381) @@ -127,7 +127,7 @@ fn bar() { } ``` -#### `1` (default): +#### `1`: ```rust fn foo() { println!("a"); diff --git a/rustfmt-core/rustfmt-config/src/lib.rs b/rustfmt-core/rustfmt-config/src/lib.rs index 26ccbf3b776..49402852d94 100644 --- a/rustfmt-core/rustfmt-config/src/lib.rs +++ b/rustfmt-core/rustfmt-config/src/lib.rs @@ -101,7 +101,7 @@ create_config! { "How to handle trailing commas for lists"; match_block_trailing_comma: bool, false, false, "Put a trailing comma after a block based match arm (non-block arms are not affected)"; - blank_lines_upper_bound: usize, 1, false, + blank_lines_upper_bound: usize, 5, false, "Maximum number of blank lines which can be put between items"; blank_lines_lower_bound: usize, 0, false, "Minimum number of blank lines which must be put between items"; @@ -529,7 +529,7 @@ control_brace_style = "AlwaysSameLine" trailing_semicolon = true trailing_comma = "Vertical" match_block_trailing_comma = false -blank_lines_upper_bound = 1 +blank_lines_upper_bound = 5 blank_lines_lower_bound = 0 edition = "2018" version = "One"