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

Update ClangFormat #645

Merged

Conversation

eloisebrosseau
Copy link
Contributor

@eloisebrosseau eloisebrosseau commented Dec 2, 2024

Update ClangFormat

Summarize your change.

The .clang-format was updated to the latest version and added to the .pre-commit-config.yaml. I also modernized the formatting style based on LLVM. Every options related to the include statements formatting was removed since it might have some side effects on some legacy parts of the codebase if they were to be reorder. Once this PR is merged, the same formatting should be applied to the commercial RV repository for consistency. Moreover, I suggest to make another PR to format all the files afterwards and to add a .git-blame-ignore-revs to avoid having the formatting commit show up when using git blame. Ideally, once this is done, we should add a formatting validation in our CI pipeline to avoid relying only on users installing the pre-commit hook to follow the formatting convention.

Describe the reason for the change.

The .clang-format had a lot of deprecated options and not all the files were formatted the same way.

If possible, provide screenshots.

Here's an example of what a formatted file would look like with the new .clang-format. Please let me know if you don't agree with any of the chosen options.

Screenshot 2024-12-02 at 11 47 35 AM
Screenshot 2024-12-02 at 11 47 59 AM
Screenshot 2024-12-02 at 11 48 22 AM
Screenshot 2024-12-02 at 11 48 33 AM

@eloisebrosseau eloisebrosseau marked this pull request as ready for review December 2, 2024 21:15
Copy link
Contributor

@bernie-laberge bernie-laberge left a comment

Choose a reason for hiding this comment

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

LGTM

Note that when we first made a public release of Open RV, we had a clang-format that turned out introducing an issue that we didn't have time to investigate at the time. Which is why we decided not to include clang-format as part of the pre-commit at the time. To be honest, I don't remember what was the symptom but I believe it was pretty catastrophic (RV wouldn't launch) so it will be easy to detect.

Thank you @eloisebrosseau for looking into this!

@eloisebrosseau eloisebrosseau merged commit 04c6af9 into AcademySoftwareFoundation:main Dec 12, 2024
10 checks passed
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.

4 participants