Add clang-format config file for formatting C++ code

master
Sébastien Villemot 2023-11-21 12:44:44 +01:00
parent 46aa6610ab
commit c4c14963a1
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
2 changed files with 19 additions and 0 deletions

18
.clang-format Normal file
View File

@ -0,0 +1,18 @@
# This file should be kept in sync with the one in dynare.git (which also
# contains more explanations).
Language: Cpp
Standard: c++20
ColumnLimit: 100
BasedOnStyle: GNU
AllowShortFunctionsOnASingleLine: InlineOnly
AlwaysBreakTemplateDeclarations: Yes
BreakConstructorInitializers: AfterColon
BreakInheritanceList: AfterColon
Cpp11BracedListStyle: true
DeriveLineEnding: false
IndentPPDirectives: AfterHash
PPIndentWidth: 1
PointerAlignment: Left
SpaceAfterTemplateKeyword: false
SpaceBeforeParens: ControlStatements
SpaceBeforeCpp11BracedList: true

View File

@ -3,6 +3,7 @@
project('dynare-preprocessor', 'cpp',
version : '6-unstable',
# NB: update C++ standard in .clang-format whenever the following is modified
default_options : [ 'cpp_std=gnu++20', 'warning_level=2' ],
meson_version : '>=0.64.0')