-
Notifications
You must be signed in to change notification settings - Fork 958
Skipping formatting of some configuration snippets #2409
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
Conversation
is it possible to just use |
Correct me if I'm wrong, but from what I can see, I could use it on everything in the snippet that would actually need to have it, but that line of thinking led me to the realization that it will look strange to have that in the example and then in the next code block have code that was formatted (presumably omitting the What if we just introduce a new convention that does not use special directives that can be followed to not test a snippet? I'm thinking something close to what's already in Configurations.md. Currently, for the first part in question we have
I suggest we change the first header to |
When you write |
Thanks for explaining! You are right that Here are three ways we could get through this:
My favorite is Option 2. |
b6adfa3
to
e054b1d
Compare
I went ahead and preemptively implemented a draft Option 2. If we decide to go with something else, I'm happy to change it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks good. I have a nagging feeling that there might be some edge case where option 2 doesn't work, but lets do this for now, and deal with anything that comes up if/when it actually does.
However, this does need a rebase, sorry (and sorry it took a while to review - I was away from work most of last week).
e054b1d
to
429dad7
Compare
Thanks, @nrc! Rebased. No worries about the review delay. Thank you for taking the time to look and discuss! |
Configurations.md contains two snippets (here and here) whose format is not meant to verified. The current code in master tries and fails to format those snippets. This PR introduces a mechanism to opt configuration code snippets out of verification.
To opt a snippet out of verification, add
// rustfmt: skip
to the top of the snippet. This is visible when viewing the file through the web UI.Here is the output of
cargo test -- --ignored
on master:Here is the output of
cargo test -- --ignored
on the PR branch:This is part of #1845.