It would be really helpful. I think there should be a .clang-format file created and a cf version mentioned in the CONTRIBUTING.rst
Sounds reasonable. I've been using .clang-format something like below.
Following links will be helpful.
.clang-format : https://clangformat.com/ BasedOnStyle: Google
Language: Cpp
Standard: Cpp11
UseTab: Never
IndentWidth: 4
ColumnLimit: 80
PointerAlignment: Left
AlignTrailingComments: true
AllowShortFunctionsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakTemplateDeclarations: true
BreakBeforeBinaryOperators: true
BreakBeforeBraces: Allman
BreakBeforeTernaryOperators: true
ConstructorInitializerAllOnOneLineOrOnePerLine: true
Cpp11BracedListStyle: true
IndentCaseLabels: false
IndentFunctionDeclarationAfterType: true
NamespaceIndentation: None
I've run https://github.com/johnmcfarlane/unformat and it created the following .clang-format file. It only did some minor changes to format.h, I recommend you try it out @vitaut.
clang-format.txt
(Had to rename the file for github)
Jonathan's .clang-format can be simplified to just
BasedOnStyle: Google
AlwaysBreakTemplateDeclarations: true
Enjoy!
Most helpful comment
Jonathan's
.clang-formatcan be simplified to justEnjoy!