Skip to content

fmt: Format all files - #502

Closed
LazyHatGuy wants to merge 2 commits into
Marvisak:mainfrom
LazyHatGuy:fmt
Closed

LazyHatGuy wants to merge 2 commits into
Marvisak:mainfrom
LazyHatGuy:fmt

Conversation

@LazyHatGuy

Copy link
Copy Markdown

In order for the lint job to pass in #481, the current files need to be formatted

Signed-off-by: LazyHatGuy <1010359+LazyHatGuy@users.noreply.github.com>
Signed-off-by: LazyHatGuy <1010359+LazyHatGuy@users.noreply.github.com>

@sebastianspicker sebastianspicker left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Tested c2609ea against main ffe310e (macOS, Rust 1.98.1, Windows-target clippy via cargo-xwin).

  • The branch is exactly what cargo fmt --all with the pinned rustfmt produces on ffe310e: byte-identical tree, nothing else changed. So if main moves, it can be regenerated instead of rebased.
  • Windows clippy (--workspace --all-targets -- -D warnings, as ci.yml runs it) fails with two undocumented_unsafe_blocks errors, at victory-gpu/src/list.rs:1464 and victory-gpu/src/watch.rs:369. Formatting splits two test asserts so the // SAFETY: comment ends up above assert!( and no longer above the unsafe block. Binding the value first fixes both, and then clippy passes with and without --all-features:
// SAFETY: the list is ours.
let uploads = unsafe { &(*list.cast::<List>()).uploads };
assert!(uploads.lock().unwrap().is_empty());
// SAFETY: the bytes just read.
let bytes = unsafe { std::slice::from_raw_parts((view + 100) as *const u8, 13) };
assert_eq!(bytes, b"from the disk");
  • Optional: about half the diff is xma/tables.rs going from 8 entries per row to one per line (410 to 874 lines). #[rustfmt::skip] on its 16 table consts keeps the current layout, cargo fmt --all -- --check still passes, and the PR shrinks from +1680/-631 to +870/-276.

On conflicts: I took a random sample of 40 open PRs that touch one of these 35 files. 4 of them (#96, #431, #624, #633) merge cleanly with main today and conflict after this PR; 13 already conflict with main; 23 merge cleanly either way.

#112 has a format pass too (c05812d). It still has the same two detached comments and is 160 commits behind main, so only one of the two should land.

AI-assisted.

@Marvisak

Copy link
Copy Markdown
Owner

Automated triage for the maintainers. Closing because it does not change behaviour the project needs (formatting, guards for cases that cannot occur, or notes and translations that cannot be kept current).

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

@LazyHatGuy

Copy link
Copy Markdown
Author

Automated triage for the maintainers. Closing because it does not change behaviour the project needs (formatting, guards for cases that cannot occur, or notes and translations that cannot be kept current).

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

In order for #481 to pass, the files in the project need to be formatted. In my opinion this should be something enforced

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.

3 participants