Skip to content

Rename fn_args_layout config option to fn_params_layout #4163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Configurations.md
Original file line number Diff line number Diff line change
Expand Up @@ -637,9 +637,9 @@ trailing whitespaces.
- **Possible values**: `true`, `false`
- **Stable**: No (tracking issue: [#3392](https://github.com/rust-lang/rustfmt/issues/3392))

## `fn_args_layout`
## `fn_params_layout`

Control the layout of arguments in a function
Control the layout of parameters in a function signature

- **Default value**: `"Tall"`
- **Possible values**: `"Compressed"`, `"Tall"`, `"Vertical"`
Expand Down
6 changes: 3 additions & 3 deletions rustfmt-core/rustfmt-lib/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ create_config! {
the same line with the pattern of arms";
force_multiline_blocks: bool, false, false,
"Force multiline closure bodies and match arms to be wrapped in a block";
fn_args_layout: Density, Density::Tall, true,
"Control the layout of arguments in a function";
fn_params_layout: Density, Density::Tall, true,
"Control the layout of parameters in a function signature";
brace_style: BraceStyle, BraceStyle::SameLineWhere, false, "Brace style for items";
control_brace_style: ControlBraceStyle, ControlBraceStyle::AlwaysSameLine, false,
"Brace style for control flow constructs";
Expand Down Expand Up @@ -552,7 +552,7 @@ struct_field_align_threshold = 0
enum_discrim_align_threshold = 0
match_arm_blocks = true
force_multiline_blocks = false
fn_args_layout = "Tall"
fn_params_layout = "Tall"
brace_style = "SameLineWhere"
control_brace_style = "AlwaysSameLine"
trailing_semicolon = true
Expand Down
2 changes: 1 addition & 1 deletion rustfmt-core/rustfmt-lib/src/items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2613,7 +2613,7 @@ fn rewrite_params(
&param_items,
context
.config
.fn_args_layout()
.fn_params_layout()
.to_list_tactic(param_items.len()),
Separator::Comma,
one_line_budget,
Expand Down
2 changes: 1 addition & 1 deletion rustfmt-core/rustfmt-lib/tests/config/small_tabs.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ comment_width = 80
tab_spaces = 2
newline_style = "Unix"
brace_style = "SameLineWhere"
fn_args_layout = "Tall"
fn_params_layout = "Tall"
trailing_comma = "Vertical"
indent_style = "Block"
reorder_imports = false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// rustfmt-fn_args_layout: Compressed
// Function arguments density
// rustfmt-fn_params_layout: Compressed
// Function parameter density

trait Lorem {
fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// rustfmt-fn_args_layout: Tall
// Function arguments density
// rustfmt-fn_params_layout: Tall
// Function parameter density

trait Lorem {
fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// rustfmt-fn_args_layout: Vertical
// Function arguments density
// rustfmt-fn_params_layout: Vertical
// Function parameter density

trait Lorem {
fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet);
Expand Down
2 changes: 1 addition & 1 deletion rustfmt-core/rustfmt-lib/tests/source/fn-custom-7.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// rustfmt-normalize_comments: true
// rustfmt-fn_args_layout: Vertical
// rustfmt-fn_params_layout: Vertical
// rustfmt-brace_style: AlwaysNextLine

// Case with only one variable.
Expand Down
2 changes: 1 addition & 1 deletion rustfmt-core/rustfmt-lib/tests/source/fn-custom.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-fn_args_layout: Compressed
// rustfmt-fn_params_layout: Compressed
// Test some of the ways function signatures can be customised.

// Test compressed layout of args.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-fn_args_layout: Vertical
// rustfmt-fn_params_layout: Vertical

// Empty list should stay on one line.
fn do_bar(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// rustfmt-fn_args_layout: Compressed
// Function arguments density
// rustfmt-fn_params_layout: Compressed
// Function parameter density

trait Lorem {
fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// rustfmt-fn_args_layout: Tall
// Function arguments density
// rustfmt-fn_params_layout: Tall
// Function parameter density

trait Lorem {
fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// rustfmt-fn_args_layout: Vertical
// Function arguments density
// rustfmt-fn_params_layout: Vertical
// Function parameter density

trait Lorem {
fn lorem(
Expand Down
2 changes: 1 addition & 1 deletion rustfmt-core/rustfmt-lib/tests/target/fn-custom-7.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// rustfmt-normalize_comments: true
// rustfmt-fn_args_layout: Vertical
// rustfmt-fn_params_layout: Vertical
// rustfmt-brace_style: AlwaysNextLine

// Case with only one variable.
Expand Down
2 changes: 1 addition & 1 deletion rustfmt-core/rustfmt-lib/tests/target/fn-custom.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-fn_args_layout: Compressed
// rustfmt-fn_params_layout: Compressed
// Test some of the ways function signatures can be customised.

// Test compressed layout of args.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// rustfmt-fn_args_layout: Vertical
// rustfmt-fn_params_layout: Vertical

// Empty list should stay on one line.
fn do_bar() -> u8 {
Expand Down