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

Add clang format file #31

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from
Open

Add clang format file #31

wants to merge 11 commits into from

Conversation

alexander-novo
Copy link
Collaborator

@alexander-novo alexander-novo commented Dec 2, 2024

I added options in order of:

  1. How they appear in the style guide

  2. How they appear in the current code

  3. If there are conflicts in the current code, then I picked the option I prefer

There currently isn't a formatting option for forcing a newline between includes and the rest of the file, however there is a pull request to add this feature, so it may exist in a future version.

Please see #32 for the current up to date formatting results of the file.

- Fixed an incorrect option name causing the formatting to not work
- Increased column limit to 120
- Moved access modifiers back
this aligns more cloesly with the current codebase, and seems like a good idea since most of the code will be in the `GridKit` namespace
- Short functions will never be on a single line
- Don't binpack arguments/parameters
- Align pointers and references to the left
@alexander-novo alexander-novo requested a review from pelesh December 2, 2024 22:36
@alexander-novo alexander-novo linked an issue Dec 2, 2024 that may be closed by this pull request
@alexander-novo
Copy link
Collaborator Author

I've tested that this works with the current version of clang-format shipped with Ubuntu Lunar - version 15.0.7. I don't know what versions we'd want to support, maybe others can comment what version of clang-format they have, and whether the file works for them.

There is a new option added in (I believe) the latest version - version 20.0.0, which prevents function declarations from being aligned. I don't know exactly how much this will impact the codebase?

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.

Create a .clang-format file
1 participant