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

Configure clang-format to enforce single space between definition blocks #468

Merged
merged 2 commits into from
Jan 23, 2025

Conversation

scotts
Copy link
Contributor

@scotts scotts commented Jan 23, 2025

In our clang-format file, sets:

SeparateDefinitionBlocks: Always

This setting ensures a single empty line between definition blocks. For the most part, we were already doing this in the .cpp files between function definitions. But this makes a big difference in our .h files when we define classes and structs. I find this far, far easier to read.

Since generating this PR is easy, I can also make sure to order it after any other refactoring we have going on.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jan 23, 2025
@scotts scotts marked this pull request as ready for review January 23, 2025 02:59
@scotts scotts requested a review from NicolasHug January 23, 2025 02:59
@scotts scotts merged commit 95fafc0 into pytorch:main Jan 23, 2025
12 of 33 checks passed
@scotts scotts deleted the cpp_line_spaces branch January 23, 2025 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Meta Open Source bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants