Skip to content

Commit 3cad7ae

Browse files
committed
[review] skip_macro_names -> skip_macro_invocations
1 parent ffcae6f commit 3cad7ae

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

Configurations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1006,7 +1006,7 @@ macro_rules! foo {
10061006

10071007
See also [`format_macro_matchers`](#format_macro_matchers).
10081008

1009-
## `skip_macro_names`
1009+
## `skip_macro_invocations`
10101010

10111011
Skip formatting the bodies of macro invocations with the following names.
10121012

src/config/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ create_config! {
7272
format_macro_matchers: bool, false, false,
7373
"Format the metavariable matching patterns in macros";
7474
format_macro_bodies: bool, true, false, "Format the bodies of macros";
75-
skip_macro_names: MacroSelectors, MacroSelectors::default(), false,
75+
skip_macro_invocations: MacroSelectors, MacroSelectors::default(), false,
7676
"Skip formatting the bodies of macros invoked with the following names.";
7777
hex_literal_case: HexLiteralCase, HexLiteralCase::Preserve, false,
7878
"Format hexadecimal integer literals";
@@ -580,7 +580,7 @@ license_template_path = ""
580580
format_strings = false
581581
format_macro_matchers = false
582582
format_macro_bodies = true
583-
skip_macro_names = []
583+
skip_macro_invocations = []
584584
hex_literal_case = "Preserve"
585585
empty_item_single_line = true
586586
struct_lit_single_line = true
@@ -965,11 +965,11 @@ make_backup = false
965965
}
966966

967967
#[test]
968-
fn test_override_skip_macro_names() {
968+
fn test_override_skip_macro_invocations() {
969969
let mut config = Config::default();
970-
config.override_value("skip_macro_names", r#"["*", "println"]"#);
970+
config.override_value("skip_macro_invocations", r#"["*", "println"]"#);
971971
assert_eq!(
972-
config.skip_macro_names(),
972+
config.skip_macro_invocations(),
973973
MacroSelectors(vec![
974974
MacroSelector::All,
975975
MacroSelector::Name(MacroName::new("println".to_owned()))

src/visitor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ impl<'b, 'a: 'b> FmtVisitor<'a> {
771771
) -> FmtVisitor<'a> {
772772
let mut skip_context = SkipContext::default();
773773
let mut macro_names = Vec::new();
774-
for macro_selector in config.skip_macro_names().0 {
774+
for macro_selector in config.skip_macro_invocations().0 {
775775
match macro_selector {
776776
MacroSelector::Name(name) => macro_names.push(name.to_string()),
777777
MacroSelector::All => skip_context.all_macros = true,

tests/source/skip_macro_names.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// rustfmt-skip_macro_names: ["items"]
1+
// rustfmt-skip_macro_invocations: ["items"]
22

33
macro_rules! items {
44
($($arg:item)*) => { $($arg)* };

tests/source/skip_macro_names_all.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// rustfmt-skip_macro_names: ["*","items"]
1+
// rustfmt-skip_macro_invocations: ["*","items"]
22

33
macro_rules! items {
44
($($arg:item)*) => { $($arg)* };

tests/target/skip_macro_names.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// rustfmt-skip_macro_names: ["items"]
1+
// rustfmt-skip_macro_invocations: ["items"]
22

33
macro_rules! items {
44
($($arg:item)*) => { $($arg)* };

tests/target/skip_macro_names_all.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// rustfmt-skip_macro_names: ["*","items"]
1+
// rustfmt-skip_macro_invocations: ["*","items"]
22

33
macro_rules! items {
44
($($arg:item)*) => { $($arg)* };

0 commit comments

Comments
 (0)