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

Adapt C++ code styling #144

Merged
merged 5 commits into from
Sep 9, 2024
Merged

Adapt C++ code styling #144

merged 5 commits into from
Sep 9, 2024

Conversation

romangg
Copy link
Contributor

@romangg romangg commented Sep 8, 2024

  • Use clang-format 18
  • Check clang-format on the whole repo in CI
  • Change C++ code styling in multiple aspects

While the Docker container at the moment runs with clang 17, we can prepare
already the update to 18 for clang-format as the CI runs with any version.
No need to limit the check. This way also the dbcli.cpp file is checked and
potentially other files in other subdirectories in the future.
This changes the code style in multiple ways. In particular:
- increase column limit from 80 to 100
- increase vertical space usage with braces
- right qualifier alignement (east const)
- sort includes case insensitvely
This was done via clang-format's InsertBraces option. The option is not added
permanently though since clang-format doesn't know about the code semantics
and later changes might introduce regresssions. To control braces in the future
we should use clang-tidy's readability-braces-around-statements check instead.
@LordTermor LordTermor added Daemon Changes related to the backend Refactoring Readability code changes labels Sep 9, 2024
@LordTermor LordTermor merged commit ae2ef17 into anydistro:master Sep 9, 2024
6 checks passed
@romangg romangg deleted the clang-format branch September 9, 2024 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Daemon Changes related to the backend Refactoring Readability code changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants