Skip to content

Conversation

@virtualritz
Copy link
Contributor

@virtualritz virtualritz commented Nov 17, 2025

This applies cargo fmt to current master, rustfmt.toml used:

  • unstable_features = true -- Enables unstable rustfmt features. Required for options like imports_granularity and reorder_impl_items that aren't yet stable.

  • format_code_in_doc_comments = true -- Formats Rust code blocks inside documentation comments (e.g., in /// and //! comments). Code examples in docs will be formatted consistently with the rest of your code.

  • imports_granularity = "Crate" -- Merges imports from the same crate into a single use statement. For example:

    use std::io::Read;
    use std::io::Write;

    becomes:

    use std::io::{Read, Write};
  • reorder_impl_items = true -- Reorders items within impl blocks alphabetically by item type (types, consts, macros, then methods). Helps maintain consistent ordering.

  • use_field_init_shorthand = true -- Uses field init shorthand when field name matches the variable name:

    Point { x: x, y: y }  // becomes
    Point { x, y }
  • wrap_comments = true -- Wraps comments at max_width (100 chars by default), breaking long comment lines into multiple lines for better readability.

I would try to re-base the work of Claude on this commit, if you're ok with the above.

@virtualritz
Copy link
Contributor Author

Btw, we still have more than a day, until 18. Oct., 23:59 Pacific time, to use up ~$500 of CCW creds. :)

@johannesvollmer
Copy link
Owner

johannesvollmer commented Nov 17, 2025

Hi! I just created a similar PR an hour ago :D #260
Perhaps we should merge both PRs. Yours has the detailed settings, mine has a GitHub workflows to ensure all PRs adhere to the formatting.

@johannesvollmer
Copy link
Owner

Awesome. I think the highest priority should be DWA compression. That one doesn't have an open PR yet, or did not see it? :)

@virtualritz
Copy link
Contributor Author

virtualritz commented Nov 17, 2025

Hi! I just created a similar PR an hour ago :D #260 Perhaps we should merge both PRs. Yours has the detailed settings, mine has a GitHub workflows to ensure all PRs adhere to the formatting.

Ok, I cherry-picked the workflow commit from your PR and amended my commit to contain the rustfmt::skip directive for the B44 table module in my commit.

So theoretically my commit should have everything yours had plus the rustfmt.toml with some extra niceties.

It would be good to merge either one asap so I can ask Claude to re-base the three branches, DWA, channel subsampling and deep data on this.

@johannesvollmer
Copy link
Owner

Sorry I didn't have the time to review it yet. But I'm certain we can still do it. I hope I can do some of it tomorrow or on the weekend.

@johannesvollmer
Copy link
Owner

Thanks for your patience! I know that you might not have access to Claude anymore. I still want to attempt as much as possible of this though. So, I tried running this formatting, but it does not go completely as hoped.

Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Crate`, unstable features are only available in nightly channel.
Warning: can't set `reorder_impl_items = true`, unstable features are only available in nightly channel.
Warning: can't set `unstable_features = true`, unstable features are only available in nightly channel.

Which is also the reason that the pipeline fails.

It seems we would either have to switch the whole repo toolchain to nightly, or instead remove the unstable formatting options, or always use cargo +nightly fmt. I think our best option is to remove the unstable options for now, because we should not be blocked by this

@johannesvollmer
Copy link
Owner

I took the liberty to commit into your branch, I hope that's okay? :D

Copy link
Owner

@johannesvollmer johannesvollmer left a comment

Choose a reason for hiding this comment

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

I ran the formatter locally to ensure the correctness. Thanks!

@johannesvollmer johannesvollmer merged commit 9610074 into johannesvollmer:master Jan 27, 2026
7 checks passed
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.

2 participants