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

format: run rg --files --type c --type cpp --glob '!external/' | xags clang-format -i #518

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kkysen
Copy link
Contributor

@kkysen kkysen commented Mar 3, 2025

A lot of files aren't formatted correctly, so whenever I edit files and format, it adds a lot of extra formatting fixes, which makes PRs much harder to review with all of this extraneous info.

We should probably add this to CI/pre-commit hook, but this should be enough for now.

This is a more complete fix to #516, which was getting in the way of reviewing #514.

@fw-immunant
Copy link
Contributor

This looks to have broken lit testing for the rewriter.

@kkysen
Copy link
Contributor Author

kkysen commented Mar 3, 2025

This looks to have broken lit testing for the rewriter.

Oh weird, it worked fine locally. I'll fix it later at some point, not too important if it's not trivial.

@kkysen kkysen force-pushed the kkysen/clang-format branch from b67eac5 to 9567b6b Compare March 3, 2025 20:10
…gs clang-format -i`

A lot of files aren't formatted correctly,
so whenever I edit files and format,
it adds a lot of extra formatting fixes,
which makes PRs much harder to review
with all of this extraneous info.

We should probably add this to CI/pre-commit hook,
but this should be enough for now.

This also adds `AllowShortBlocksOnASingleLine: Always` to `.clang-format`,
as this is needed to keep LLVM `lit` tests still working.
@kkysen kkysen force-pushed the kkysen/clang-format branch from 9567b6b to f039543 Compare March 3, 2025 20:11
@fw-immunant
Copy link
Contributor

I'd like to wait until other PRs land before we merge this, since it'll create a lot of conflicts. There are also some formatting decisions that clang-format makes here that really destroy readability, mostly around macros. Can we ask clang-format not to alter macro definitions? E.g. see ia2_internal.h where it puts comments and newlines on the wrong lines.

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