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

Fully-automatic clang-format with include reordering #3713

Merged
merged 3 commits into from
Feb 10, 2022

Conversation

rwgk
Copy link
Collaborator

@rwgk rwgk commented Feb 10, 2022

Description

To be merged after PR #3712.

Suggested changelog entry:

clang-format was added to the pre-commit actions, and the entire code base automatically reformatted (after several iterations preparing for this leap).

@rwgk rwgk changed the title clang-format with include reordering (on top of #3708) Fully-automatic clang-format with include reordering Feb 10, 2022
@rwgk rwgk marked this pull request as ready for review February 10, 2022 01:36
@rwgk rwgk requested a review from henryiii as a code owner February 10, 2022 01:36
@rwgk rwgk requested a review from Skylion007 February 10, 2022 01:36
.clang-format Outdated
TabWidth: 4
IncludeCategories:
Copy link
Collaborator

Choose a reason for hiding this comment

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

This could go in before / be rebased in, doesn't need to be in the automatic commit, since we aren't running clang-format till this point.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Doing this right now.

.clang-format Outdated
@@ -9,11 +9,28 @@ BinPackParameters: false
BreakBeforeBinaryOperators: All
BreakConstructorInitializers: BeforeColon
ColumnLimit: 99
Copy link
Collaborator

Choose a reason for hiding this comment

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

i would add some comment pragmas for clang-tidy nolints

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Do you have a pointer handy to some time-tested config? Or a concrete suggestion? Happy to fold that in. (I just don't want to invent an incompatible wheel, not currently needing anything in particular.)

Copy link
Collaborator

Choose a reason for hiding this comment

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

CommentPragmas is a regular expression, can you just match it with a nolint comment? That's quite nice, actually.

@rwgk rwgk force-pushed the clang-format_with_include_reordering branch 2 times, most recently from 98313de to c0fea50 Compare February 10, 2022 18:33
@rwgk
Copy link
Collaborator Author

rwgk commented Feb 10, 2022

0497fd5

Nice! If the CI is happy here I'll cherry-pick that into #3712 (because we have all other .clang-format changes there, as suggested by @henryiii).

@rwgk
Copy link
Collaborator Author

rwgk commented Feb 10, 2022

(The 🐍 3.5 • MSVC 2017 • x64 failure is an infrastructure flake, connection timed out. Safe to ignore.)

@rwgk rwgk force-pushed the clang-format_with_include_reordering branch from 0497fd5 to 4b1c3fa Compare February 10, 2022 19:51
@rwgk
Copy link
Collaborator Author

rwgk commented Feb 10, 2022

Screen Shot 2022-02-10 at 12 16 42

@rwgk rwgk merged commit ec24786 into pybind:master Feb 10, 2022
@github-actions github-actions bot added the needs changelog Possibly needs a changelog entry label Feb 10, 2022
@rwgk rwgk deleted the clang-format_with_include_reordering branch February 10, 2022 21:29
@henryiii henryiii removed the needs changelog Possibly needs a changelog entry label Mar 29, 2022
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