-
Notifications
You must be signed in to change notification settings - Fork 1k
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
tgross35
merged 6 commits into
rust-lang:libc-0.2
from
tgross35:backport-format-macro-bodies
Nov 19, 2024
Merged
[0.2] ci: use some tricks to format macro bodies #4110
tgross35
merged 6 commits into
rust-lang:libc-0.2
from
tgross35:backport-format-macro-bodies
Nov 19, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
r? @JohnTitor rustbot has assigned @JohnTitor. Use |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport #4107