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

Various cleanups: Enable more clang-format #4192

Merged
merged 7 commits into from Nov 17, 2023

Conversation

StephanTLavavej
Copy link
Member

clang-format has significantly improved its handling of concepts, so this PR removes over a hundred suppressions (from 295 down to 173).

In general, we should suppress clang-format only when it would do something egregious, or when there's a significant advantage to manual formatting (e.g. custom alignment of a table, or staying similar to upstream code). I looked at each of these suppression removals, and I believe that they're all neutral or an improvement. (I refrained from removing suppressions where clang-format would damage whitespace around &&. I also refrained from removals that would impact a lot of code, even if I thought the impact was positive; those are candidates for future cleanups.)

I've structured this into a series of commits for easier review, listed below. There are no behavioral changes or other drive-by cleanups, and only a couple of manual changes to comments. (In this PR, I've refrained from adding empty comments to partially control formatting.)

  • Yay, no reflow!
  • Yay, no reflow except indentation!
  • Yay, no reflow when shrinking suppressed region!
  • Reflow looks good, alignment was unnecessary.
  • Reflow looks good, change C to C++ comment to avoid orphaning it.
  • Reflow looks good, manually unwrap comment.
  • Reflow looks good.
    • This is where the bulk of the changes are happening. I recommend looking at this commit in VSCode, with a non-inline view, so you can focus on the "after" state and verify that it's readable.

@StephanTLavavej StephanTLavavej added the enhancement Something can be improved label Nov 13, 2023
@StephanTLavavej StephanTLavavej requested a review from a team as a code owner November 13, 2023 21:21
@github-actions github-actions bot added this to Initial Review in Code Reviews Nov 13, 2023
@StephanTLavavej StephanTLavavej moved this from Initial Review to Final Review in Code Reviews Nov 13, 2023
@CaseyCarter CaseyCarter moved this from Final Review to Ready To Merge in Code Reviews Nov 15, 2023
@StephanTLavavej StephanTLavavej self-assigned this Nov 16, 2023
@StephanTLavavej
Copy link
Member Author

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit e6d61a4 into microsoft:main Nov 17, 2023
37 checks passed
Code Reviews automation moved this from Ready To Merge to Done Nov 17, 2023
@StephanTLavavej StephanTLavavej deleted the clang-format branch November 17, 2023 02:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Something can be improved
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants