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

[0.2] ci: use some tricks to format macro bodies #4110

Merged
merged 6 commits into from
Nov 19, 2024

Conversation

tgross35
Copy link
Contributor

Backport #4107

Currently this only matches `$body` if every line ends with a semicolon.
Make this simpler by just using the `block` matcher.

Additionally, allow a trailing comma.

(backport <rust-lang#4107>)
(cherry picked from commit 0ac42fd)
Apparently we already violate this in a few places, it just doesn't show
up because whitespace doesn't line up with what we expect (lack of
formatting). Just disable it for now so we can format the files.

(backport <rust-lang#4107>)
(cherry picked from commit 0189456)
The script shouldn't need to update `rustfmt` every time it gets run.

Additionally, only pass `--check` when in CI so this script can be used
for invoking the formatter locally.

(backport <rust-lang#4107>)
(cherry picked from commit 64ed860)
We have a lot of syntax contained within macro bodies, which `rustfmt`
doesn't touch. Add a hack that replaces relevant macro invocations with
functions, formats, then resets.

(backport <rust-lang#4107>)
(cherry picked from commit 6ab46bb)
Run `ci/style.sh` with the changes introduced in [1].

[1]: rust-lang#4107

(backport <rust-lang#4107>)

This is the `libc-0.2` version of 49cb0ff ("Apply formatting to macro
bodies"), though not a direct cherry pick.
Start with the commit for formatting macro bodies in [1].

[1]: rust-lang#4107

(backport <rust-lang#4107>)

This is the `libc-0.2` version of 6269954 ("Introduce a
git-blame-ignore-revs file") with the ignored rev changed to what is
applicable for this branch.
@tgross35 tgross35 marked this pull request as ready for review November 19, 2024 03:12
@rustbot
Copy link
Collaborator

rustbot commented Nov 19, 2024

r? @JohnTitor

rustbot has assigned @JohnTitor.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot
Copy link
Collaborator

rustbot commented Nov 19, 2024

Some changes occurred in solarish module

cc @jclulow, @pfmooney

Some changes occurred in OpenBSD module

cc @semarie

@tgross35 tgross35 added this pull request to the merge queue Nov 19, 2024
Merged via the queue into rust-lang:libc-0.2 with commit abfe64f Nov 19, 2024
44 checks passed
@tgross35 tgross35 deleted the backport-format-macro-bodies branch November 19, 2024 05:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment