Skip to content

Commit 89ec6d1

Browse files
committed
[review] skip_macro_names -> skip_macro_invocations
1 parent a88ec63 commit 89ec6d1

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
@@ -1014,7 +1014,7 @@ macro_rules! foo {
10141014

10151015
See also [`format_macro_matchers`](#format_macro_matchers).
10161016

1017-
## `skip_macro_names`
1017+
## `skip_macro_invocations`
10181018

10191019
Skip formatting the bodies of macro invocations with the following names.
10201020

src/config/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ create_config! {
7070
format_macro_matchers: bool, false, false,
7171
"Format the metavariable matching patterns in macros";
7272
format_macro_bodies: bool, true, false, "Format the bodies of macros";
73-
skip_macro_names: MacroSelectors, MacroSelectors::default(), false,
73+
skip_macro_invocations: MacroSelectors, MacroSelectors::default(), false,
7474
"Skip formatting the bodies of macros invoked with the following names.";
7575
hex_literal_case: HexLiteralCase, HexLiteralCase::Preserve, false,
7676
"Format hexadecimal integer literals";
@@ -617,7 +617,7 @@ normalize_doc_attributes = false
617617
format_strings = false
618618
format_macro_matchers = false
619619
format_macro_bodies = true
620-
skip_macro_names = []
620+
skip_macro_invocations = []
621621
hex_literal_case = "Preserve"
622622
empty_item_single_line = true
623623
struct_lit_single_line = true
@@ -1028,11 +1028,11 @@ make_backup = false
10281028
}
10291029

10301030
#[test]
1031-
fn test_override_skip_macro_names() {
1031+
fn test_override_skip_macro_invocations() {
10321032
let mut config = Config::default();
1033-
config.override_value("skip_macro_names", r#"["*", "println"]"#);
1033+
config.override_value("skip_macro_invocations", r#"["*", "println"]"#);
10341034
assert_eq!(
1035-
config.skip_macro_names(),
1035+
config.skip_macro_invocations(),
10361036
MacroSelectors(vec![
10371037
MacroSelector::All,
10381038
MacroSelector::Name(MacroName::new("println".to_owned()))

src/visitor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ impl<'b, 'a: 'b> FmtVisitor<'a> {
772772
) -> FmtVisitor<'a> {
773773
let mut skip_context = SkipContext::default();
774774
let mut macro_names = Vec::new();
775-
for macro_selector in config.skip_macro_names().0 {
775+
for macro_selector in config.skip_macro_invocations().0 {
776776
match macro_selector {
777777
MacroSelector::Name(name) => macro_names.push(name.to_string()),
778778
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)