Skip to content
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

handle skip_macro_invocations from config file #5817

Merged
merged 1 commit into from
Jul 5, 2023

Conversation

calebcartwright
Copy link
Member

fixes #5816

We need to keep the FromStr impl for MacroSelector (e.g. to support command line config args), so seems reasonable to just have the serde deserializer use that impl too.

I'm not sure whether there's a better/simpler approach to achieve that (e.g. an item-level serde attribute), but adding our own Deserialize impl seems trivial enough

@calebcartwright calebcartwright added the release-notes Needs an associated changelog entry label Jul 5, 2023
@ytmimi
Copy link
Contributor

ytmimi commented Jul 5, 2023

Might be tricky to write a system test for this since skip_macro_invocations is unstable, and stable rustfmt won't actually set the value it finds in the rustfmt.toml.

Mismatch at tests/source\skip_macro_invocations\config_file.rs:1:
 // rustfmt-config: issue-5816.toml
 
 fn main() {
-    println!(             "Hello, world!");
+    println!("Hello, world!");
     let x = 7;
 }

@calebcartwright
Copy link
Member Author

Nuts. Will circle back to this later when I can

Copy link
Contributor

@ytmimi ytmimi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I knew about // rustfmt-unstable: true, so I learned something! Changes look good to me!

@ytmimi ytmimi merged commit f2bad9c into rust-lang:master Jul 5, 2023
@calebcartwright calebcartwright deleted the issue-5816 branch July 7, 2023 14:02
@ytmimi ytmimi removed the release-notes Needs an associated changelog entry label Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

skip_macro_invocations: Cannot configure from rustfmt.toml
2 participants