Skip to content

Commit 90c5792

Browse files
committed
Set rustfmt-format_macro_matchers to false by default
cc #2543
1 parent 79c5ee8 commit 90c5792

File tree

6 files changed

+10
-5
lines changed

6 files changed

+10
-5
lines changed

Configurations.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,10 +1055,10 @@ Format the bodies of macros.
10551055

10561056
```rust
10571057
macro_rules! foo {
1058-
($a:ident : $b:ty) => {
1058+
($a: ident : $b: ty) => {
10591059
$a(42): $b;
10601060
};
1061-
($a:ident $b:ident $c:ident) => {
1061+
($a: ident $b: ident $c: ident) => {
10621062
$a = $b + $c;
10631063
};
10641064
}
@@ -1068,8 +1068,8 @@ macro_rules! foo {
10681068

10691069
```rust
10701070
macro_rules! foo {
1071-
($a:ident : $b:ty) => { $a(42): $b; };
1072-
($a:ident $b:ident $c:ident) => { $a=$b+$c; };
1071+
($a: ident : $b: ty) => { $a(42): $b; };
1072+
($a: ident $b: ident $c: ident) => { $a=$b+$c; };
10731073
}
10741074
```
10751075

src/config/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ create_config! {
5353
license_template_path: String, String::default(), false,
5454
"Beginning of file must match license template";
5555
format_strings: bool, false, false, "Format string literals where necessary";
56-
format_macro_matchers: bool, true, false,
56+
format_macro_matchers: bool, false, false,
5757
"Format the metavariable matching patterns in macros";
5858
format_macro_bodies: bool, true, false, "Format the bodies of macros";
5959

tests/source/macro_rules.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// rustfmt-format_macro_matchers: true
12

23
macro_rules! m {
34
() => ();

tests/source/macros.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// rustfmt-normalize_comments: true
2+
// rustfmt-format_macro_matchers: true
23
itemmacro!(this, is.now() .formatted(yay));
34

45
itemmacro!(really, long.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbb() .is.formatted());

tests/target/macro_rules.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// rustfmt-format_macro_matchers: true
2+
13
macro_rules! m {
24
() => {};
35
($x:ident) => {};

tests/target/macros.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// rustfmt-normalize_comments: true
2+
// rustfmt-format_macro_matchers: true
23
itemmacro!(this, is.now().formatted(yay));
34

45
itemmacro!(

0 commit comments

Comments
 (0)