Set rustfmt-format_macro_matchers to false by default

cc #2543
This commit is contained in:
Nick Cameron 2018-07-18 12:09:50 +12:00
parent 79c5ee8b42
commit 90c5792565
6 changed files with 10 additions and 5 deletions

View file

@ -1055,10 +1055,10 @@ Format the bodies of macros.
```rust ```rust
macro_rules! foo { macro_rules! foo {
($a:ident : $b:ty) => { ($a: ident : $b: ty) => {
$a(42): $b; $a(42): $b;
}; };
($a:ident $b:ident $c:ident) => { ($a: ident $b: ident $c: ident) => {
$a = $b + $c; $a = $b + $c;
}; };
} }
@ -1068,8 +1068,8 @@ macro_rules! foo {
```rust ```rust
macro_rules! foo { macro_rules! foo {
($a:ident : $b:ty) => { $a(42): $b; }; ($a: ident : $b: ty) => { $a(42): $b; };
($a:ident $b:ident $c:ident) => { $a=$b+$c; }; ($a: ident $b: ident $c: ident) => { $a=$b+$c; };
} }
``` ```

View file

@ -53,7 +53,7 @@ create_config! {
license_template_path: String, String::default(), false, license_template_path: String, String::default(), false,
"Beginning of file must match license template"; "Beginning of file must match license template";
format_strings: bool, false, false, "Format string literals where necessary"; format_strings: bool, false, false, "Format string literals where necessary";
format_macro_matchers: bool, true, false, format_macro_matchers: bool, false, false,
"Format the metavariable matching patterns in macros"; "Format the metavariable matching patterns in macros";
format_macro_bodies: bool, true, false, "Format the bodies of macros"; format_macro_bodies: bool, true, false, "Format the bodies of macros";

View file

@ -1,3 +1,4 @@
// rustfmt-format_macro_matchers: true
macro_rules! m { macro_rules! m {
() => (); () => ();

View file

@ -1,4 +1,5 @@
// rustfmt-normalize_comments: true // rustfmt-normalize_comments: true
// rustfmt-format_macro_matchers: true
itemmacro!(this, is.now() .formatted(yay)); itemmacro!(this, is.now() .formatted(yay));
itemmacro!(really, long.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbb() .is.formatted()); itemmacro!(really, long.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbb() .is.formatted());

View file

@ -1,3 +1,5 @@
// rustfmt-format_macro_matchers: true
macro_rules! m { macro_rules! m {
() => {}; () => {};
($x:ident) => {}; ($x:ident) => {};

View file

@ -1,4 +1,5 @@
// rustfmt-normalize_comments: true // rustfmt-normalize_comments: true
// rustfmt-format_macro_matchers: true
itemmacro!(this, is.now().formatted(yay)); itemmacro!(this, is.now().formatted(yay));
itemmacro!( itemmacro!(