Skip to content

Conversation

@sbernauer
Copy link
Member

Enable format_code_in_doc_comments and let cargo +nightly-2025-10-23 fmt --all format the code.

The unstable feature isn't perfect (there are some weird spaces being added), but in my opinion this is a significant improvement.

@sbernauer sbernauer self-assigned this Dec 19, 2025
@sbernauer sbernauer moved this to Development: Waiting for Review in Stackable Engineering Dec 19, 2025
@sbernauer sbernauer force-pushed the chore/format-rustdoc branch from e4340c1 to 282a975 Compare December 19, 2025 12:19
Comment on lines 86 to 90
/// .service_name("test")
/// .build()
/// .init()?;
/// tracing::info!("log a message");
/// Ok(()) // < Scope ends here, guard is dropped
Copy link
Member

Choose a reason for hiding this comment

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

This is a change we don't want.

Copy link
Member

Choose a reason for hiding this comment

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

If there's a lint that allows for aligned comments, we could enable it here?
But we also want the empty lines.

Copy link
Member

Choose a reason for hiding this comment

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

If there's a lint that allows for aligned comments

I have no clue if such a thing exists... But others also asked for this: https://users.rust-lang.org/t/rustfmt-and-alignment-of-trailing-comments/39121

I think the best option would be to use #[rustfmt::skip] here.

Copy link
Member Author

Choose a reason for hiding this comment

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

My first try with #[rustfmt::skip] didn't work, now it did 🤷 7690e04

Copy link
Member

Choose a reason for hiding this comment

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

This will technically disable formatting for the actual code (struct) as well, but I guess there is no other way around it. Or can we disable doc code formatting just for these doc comments?

Copy link
Member

Choose a reason for hiding this comment

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

Most of these changes are a little weird.

@Techassi Techassi moved this from Development: Waiting for Review to Development: In Review in Stackable Engineering Dec 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Development: In Review

Development

Successfully merging this pull request may close these issues.

4 participants