diana:diana_codestyle

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

diana:diana_codestyle [2018-04-16 09:50:20]
alexanderb break after template
diana:diana_codestyle [2022-05-31 09:29:31]
Line 1: Line 1:
-====== Code style ====== 
- 
-To gradually improve the code style in diana, we ask to format all changesets using [[http://releases.llvm.org/4.0.0/tools/clang/docs/ClangFormat.html|clang-format]] (4.0) with these style options: 
- 
-<file - .clang-format> 
---- 
-BasedOnStyle: LLVM 
-Language: Cpp 
-PointerAlignment: Left 
-ColumnLimit: 160 
-AllowShortFunctionsOnASingleLine: Inline 
-AlwaysBreakTemplateDeclarations: true 
-BreakBeforeBraces: Custom 
-BraceWrapping: 
-  AfterClass:      true 
-  AfterFunction:   true 
-  AfterStruct:     true 
-  AfterUnion:      true 
-BreakConstructorInitializersBeforeComma: true 
-... 
- 
-</file> 
- 
-This style configuration should be saved in the diana top-level source-directory as ''.clang-format''. 
- 
-We suggest using [[https://gist.github.com/spott/98e25623ebc1d923dce4|git-clang-format]] to reformat modified lines: 
- 
-  * save [[https://gist.github.com/spott/98e25623ebc1d923dce4|git-clang-format]] in your ''PATH'' and make it executable 
-  * if ''clang-format'' is not version 4.0, it might necessary to configure git with <code>git config  clangFormat.binary clang-format-4.0</code> 
-  * preview reformatted modifications with <code>git clang-format --diff</code> 
-  * reformat modifications with <code>git clang-format -f</code> 
  
  • diana/diana_codestyle.txt
  • Last modified: 2022-05-31 09:29:31
  • (external edit)