Configure clang-format

A .clang-format configuration template I prefer to use.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# .clang-format
# Run manually to reformat a file:
# clang-format -i --style=file <file>
# find . -iname '*.cc' -o -iname '*.h' -o -iname '*.h.in' | xargs clang-format -i --style=file

Language: Cpp
BasedOnStyle: Google
# The offset of Access specifier(public/protected/private)
AccessModifierOffset: -4
AllowShortBlocksOnASingleLine: false
AllowShortFunctionsOnASingleLine: false
AllowShortLambdasOnASingleLine: false
ColumnLimit: 120
DerivePointerAlignment: false
IndentWidth: 4

Configure clang-format
http://wasprime.github.io/Configuration/clang/Configure-clang-format/
Author
wasPrime
Posted on
May 4, 2023
Updated on
May 3, 2023
Licensed under