-
Notifications
You must be signed in to change notification settings - Fork 182
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
Format code in doc comments #1899
Conversation
This is awesome, thanks so much for finding and filing it! I was hoping this feature will one day be available :) A couple notes:
|
Praise: I'm glad that we can do this now Thoughts:
|
There doesn't seem to be an option for this.
We could set it on CI, but you'd always have to remember to do |
Not that I know, but even if we set this it would apply to non-doc code as well
Only
Done
I think markdown is messing up what you're trying to say? I'm not code-quoting the output because they are nice strings, do you think I should? |
Yeah. Generally I think |
I think the main issue here is that both @zbraniecki and I would like to see the docs with various formatting settings that are different from the ones used for regular code. @robertbastian says that there is currently no way to configure separate formatting within Can we make a duckscript task that runs |
We can also run this as a separate optional CI job and fix it occasionally. Our CI still uses nightly in places. |
My preference is very weak and I'd side with consistency over my personal preference. I also don't feel it's worth spending a lot of time to add it to CI now. If it's easy, great, if not, make it manual before release. |
This PR will be annoying to keep conflict-free, @sffc I don't know how strong your objections are, so please either merge as is or close and we can revisit this later. |
Discussion:
Conclusion: Merge the PR. |
Filed rust-lang/rustfmt#5345 |
@robertbastian @sffc so rustfmt now has a separate config feature for this on nightly, rust-lang/rustfmt#5345 (comment) are y'all comfortable with us trying it out? |
Yeah! |
I ran
cargo +nightly fmt -- --config=format_code_in_doc_comments=true
. We can't make this a default flag because it's only available on nightly, but maybe we should add it to the prerelease tasks?components/datetime/src/options/length.rs
andcomponents/plurals/src/lib.rs
contain manual touchups