Skip to content

Conversation

@rdmark
Copy link
Member

@rdmark rdmark commented Dec 23, 2025

This reverts a previous change where configurations for the Eclipse IDE specifically was introduced.

I think it's more important to have an IDE agnostic formatting framework, which clang-format provides

Example command for formatting all C++ source code, as run from within the cpp dir:

find . -iname '*.h' -o -iname '*.cpp' | xargs clang-format -i

@rdmark rdmark marked this pull request as ready for review December 23, 2025 22:26
@rdmark rdmark requested a review from akuker as a code owner December 23, 2025 22:26
Copy link
Member

@nucleogenic nucleogenic left a comment

Choose a reason for hiding this comment

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

Makes sense! 🧹

@rdmark rdmark force-pushed the 1464-dev-only-migrate-c-format-settings-to-clang-format branch from 9a0797e to 4630432 Compare December 23, 2025 22:39
@rdmark
Copy link
Member Author

rdmark commented Dec 23, 2025

@nucleogenic do you have a preference of tab indentation vs. space indentation?

The majority of C++ files use tab indentation right now, but there's a sizable chunk of space indented code too. Whatever we do there's going to be a huge diff.

This reverts a previous change where configurations for the Eclipse IDE specifically was introduced.

I think it's more important to have an IDE agnostic formatting framework, which clang-format provides

Example command for formatting all C++ source code, as run from within the cpp dir:

find . -iname '*.h' -o -iname '*.cpp' | xargs clang-format -i
@rdmark rdmark force-pushed the 1464-dev-only-migrate-c-format-settings-to-clang-format branch from 4630432 to b509d1c Compare December 24, 2025 07:53
@sonarqubecloud
Copy link

@rdmark
Copy link
Member Author

rdmark commented Dec 24, 2025

I will postpone the wholesale reformatting of the codebase to another time. After reformatting the code does compile and sonarqube doesn't complain about new issues, so it should be fine. I had to add two rules compared to the original by @akuker -- namely IncludeBlocks: Preserve and SortIncludes: false. When clang-format messed with the header include order certain symbols didn't get declared in time for other parts of the code.

Future improvements include adding a formatting check to CI, introduce git hooks and helper scripts.

@rdmark rdmark merged commit 6b7d140 into develop Dec 24, 2025
9 checks passed
@rdmark rdmark deleted the 1464-dev-only-migrate-c-format-settings-to-clang-format branch December 24, 2025 08:53
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