Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configuring clang-format for isocpp's core guidelines

I want to follow the CppCoreGuidelines as close as possible but I have some problems configuring clang-format.

How do I configure clang-format to conform with the isocpp core guidelines?

For example the following guideline gives me some trouble.

https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rl-ptr

clang-format always seems to choose T &operator[](size_t); and I am unable to find the correct setting for it.

like image 566
Maik Klein Avatar asked Sep 15 '25 17:09

Maik Klein


1 Answers

Add this to your .clang-format

PointerAlignment: Left

You can test it online in the clang-format-configurator

like image 103
maddouri Avatar answered Sep 18 '25 09:09

maddouri