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

As a consequence, drop old uncrustify config file.
remove-priordens
Sébastien Villemot 2023-11-21 12:46:06 +01:00
parent e15fba807f
commit 627bbb0a91
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
4 changed files with 25 additions and 3129 deletions

23
.clang-format Normal file
View File

@ -0,0 +1,23 @@
# NB: whenever the present file is modified, the same modification should be
# applied to the copy in preprocessor.git
# For the list of options (clang-format 14, present in Debian “bookworm” 12), see:
# https://releases.llvm.org/14.0.0/tools/clang/docs/ClangFormatStyleOptions.html
# Effective configuration can be obtained with:
# clang-format --dump-config
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

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

@ -1 +1 @@
Subproject commit 46aa6610ab13f449ba4423e02e5df3a2cb6f7e01
Subproject commit c4c14963a1d66009fcf04fbc63fdffff4384d9fd

File diff suppressed because it is too large Load Diff