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

Prettyfied use statements in the whole project #451

Merged
merged 2 commits into from
Jan 3, 2023
Merged

Prettyfied use statements in the whole project #451

merged 2 commits into from
Jan 3, 2023

Conversation

jounathaen
Copy link
Member

No description provided.

@codecov
Copy link

codecov bot commented Jan 2, 2023

Codecov Report

Merging #451 (f2e54da) into master (5c71fd1) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #451   +/-   ##
=======================================
  Coverage   63.46%   63.46%           
=======================================
  Files          16       16           
  Lines        2206     2206           
=======================================
  Hits         1400     1400           
  Misses        806      806           
Impacted Files Coverage Δ
src/arch/x86_64/mod.rs 68.14% <ø> (ø)
src/bin/uhyve.rs 0.62% <ø> (ø)
src/linux/gdb/breakpoints.rs 91.89% <ø> (ø)
src/linux/gdb/mod.rs 88.72% <ø> (ø)
src/linux/gdb/section_offsets.rs 100.00% <ø> (ø)
src/linux/uhyve.rs 66.97% <ø> (ø)
src/linux/vcpu.rs 70.14% <ø> (ø)
src/linux/virtio.rs 13.29% <ø> (ø)
src/linux/virtqueue.rs 0.00% <ø> (ø)
src/vm.rs 75.24% <ø> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Member

@mkroening mkroening left a comment

Choose a reason for hiding this comment

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

This should be done in an automated fashion.

I did something similar for libhermit-rs: hermit-os/kernel@d2e6c6d

@stlankes and I agreed to set imports_granularity to Module. You seem to prefer setting it to Crate. What do you think?

@mkroening
Copy link
Member

mkroening commented Jan 2, 2023

Ah, these features require nightly rustfmt. So for the format CI we would use:

  - uses: dtolnay/rust-toolchain@stable
    with:
      components: rustfmt

@jounathaen
Copy link
Member Author

Yeah, adding it to rustfmt is a good idea.
I like Crate more, but If you feel different about it, we can use Module as well.
Before it was apparently Whatever, which I prefer the least 😛
I added the options to the .rustfmt.toml and fmted everything.

Copy link
Member

@mkroening mkroening left a comment

Choose a reason for hiding this comment

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

Ah, these features require nightly rustfmt. So for the format CI we would use:

  - uses: dtolnay/rust-toolchain@stable
    with:
      components: rustfmt

Without this, CI silently does not check for correct formatting.

Also, could you squash everything? :)

.rustfmt.toml Outdated Show resolved Hide resolved
@jounathaen jounathaen force-pushed the pretty_use branch 2 times, most recently from c581a42 to 30544d7 Compare January 2, 2023 16:41
@jounathaen
Copy link
Member Author

Ah, these features require nightly rustfmt. So for the format CI we would use:

  • uses: dtolnay/rust-toolchain@stable
    with:
    components: rustfmt

Stable? - Not nightly?

@jounathaen
Copy link
Member Author

Honestly, I'd suggest not to include a nightly CI check here, but simply wait until that feature is stabilized. It is a very minor thing and if a few use statements are off, that's not a big deal.

@mkroening
Copy link
Member

bors r+

@bors bors bot merged commit 7455ee8 into master Jan 3, 2023
@bors bors bot deleted the pretty_use branch January 3, 2023 11:31
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.

None yet

2 participants