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

Change clang-format style #790

Merged
merged 3 commits into from
Jul 16, 2019
Merged

Change clang-format style #790

merged 3 commits into from
Jul 16, 2019

Conversation

julianoes
Copy link
Collaborator

@julianoes julianoes commented Jul 12, 2019

AlignAfterOpenBracket -> AlwaysBreak

The main reason for this change is to work around a clang-format bug in AlignAfterOpenBracked introduced with clang-format 8:
https://bugs.llvm.org/show_bug.cgi?id=41676

By changing to this option, we resolve the problem were different versions enforce different styles.

Also, in my opinion this style makes more sense in general.
For some argumentation by Kevlin Henney, I suggest to watch:
https://youtu.be/ZsHMHukIlJY?t=1027

PointerAlignment -> Left

We wanted to switch the pointer and reference alignment style for a while. Given now we just had many automatic changes with the previous style change as well as the rename, it makes sense to do this change
now.

The reasoning is mostly that this is more common in C++ in general and that it is recommended by the CppCoreGuidelines.
https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#nl18-use-c-style-declarator-layout

Closes #412 and fixes #321.

This changes the chosen clang format style.

The main reason for this change is to work around a clang-format bug
in AlignAfterOpenBracked introduced with clang-format 8:
https://bugs.llvm.org/show_bug.cgi?id=41676

By changing to this option, we resolve the problem were different
versions enforce different styles.

Also, in my opinion this style makes more sense in general.
For some argumentation by Kevlin Henney, I suggest to watch:
https://youtu.be/ZsHMHukIlJY?t=1027
We wanted to switch the pointer and reference alignment style for a
while. Given now we just had many automatic changes with the previous
style change as well as the rename, it makes sense to do this change
now.

The reasoning is mostly that this is more common in C++ in general and
that it is recommended by the CppCoreGuidelines.
https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#nl18-use-c-style-declarator-layout
Copy link
Collaborator

@JonasVautherin JonasVautherin left a comment

Choose a reason for hiding this comment

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

Ok

@JonasVautherin JonasVautherin merged commit fb71673 into develop Jul 16, 2019
@JonasVautherin JonasVautherin deleted the change-style branch July 16, 2019 12:28
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.

Rendering of reference and pointer parameters in markdown script
2 participants