From 15a07a6f21ff4fd8091afee72a68432dd8a078d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org> Date: Fri, 27 Dec 2024 15:59:18 +0100 Subject: [PATCH] Bump to clang-format 19 Also disable RemoveSemicolon option by default, since the clang-format manual states that these options can lead to incorrect formatting and thus their result should be carefully reviewed. --- .clang-format | 1 - src/ModelTree.cc | 3 +-- src/ModelTree.hh | 11 +++++------ src/Shocks.hh | 6 +++--- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/.clang-format b/.clang-format index 21875122..8e72a98b 100644 --- a/.clang-format +++ b/.clang-format @@ -15,7 +15,6 @@ InsertNewlineAtEOF: true PackConstructorInitializers: NextLine PPIndentWidth: 1 PointerAlignment: Left -RemoveSemicolon: true SpaceAfterTemplateKeyword: false SpaceBeforeParens: ControlStatements SpaceBeforeCpp11BracedList: true diff --git a/src/ModelTree.cc b/src/ModelTree.cc index c900811e..83ea8531 100644 --- a/src/ModelTree.cc +++ b/src/ModelTree.cc @@ -1385,8 +1385,7 @@ ModelTree::writeLatexModelFile(const string& mod_basename, const string& latex_b content_output << endl << R"(\end{dmath})" << endl; } - output << R"(\include{)" << latex_basename + "_content" - << "}" << endl + output << R"(\include{)" << latex_basename + "_content" << "}" << endl << R"(\end{document})" << endl; output.close(); diff --git a/src/ModelTree.hh b/src/ModelTree.hh index 4642f8d6..8733d9af 100644 --- a/src/ModelTree.hh +++ b/src/ModelTree.hh @@ -1001,9 +1001,8 @@ ModelTree::writeModelCFile(const string& basename, const string& mexext, const filesystem::path model_src_dir {filesystem::path {basename} / "model" / "src"}; - auto [d_output, tt_output] = writeModelFileHelper < dynamic - ? ExprNodeOutputType::CDynamicModel - : ExprNodeOutputType::CStaticModel > (); + auto [d_output, tt_output] = writeModelFileHelper<dynamic ? ExprNodeOutputType::CDynamicModel + : ExprNodeOutputType::CStaticModel>(); vector<filesystem::path> header_files, object_files; // TODO: when C++20 support is complete, mark the following strings constexpr @@ -2410,9 +2409,9 @@ template<bool dynamic> void ModelTree::writeSparseModelJuliaFiles(const string& basename) const { - auto [d_sparse_output, tt_sparse_output] = writeModelFileHelper < dynamic - ? ExprNodeOutputType::juliaSparseDynamicModel - : ExprNodeOutputType::juliaSparseStaticModel > (); + auto [d_sparse_output, tt_sparse_output] + = writeModelFileHelper<dynamic ? ExprNodeOutputType::juliaSparseDynamicModel + : ExprNodeOutputType::juliaSparseStaticModel>(); filesystem::path julia_dir {filesystem::path {basename} / "model" / "julia"}; // TODO: when C++20 support is complete, mark the following strings constexpr diff --git a/src/Shocks.hh b/src/Shocks.hh index 9378f246..b55c9936 100644 --- a/src/Shocks.hh +++ b/src/Shocks.hh @@ -37,7 +37,7 @@ public: using det_shocks_t = map<int, vector<tuple<int, int, expr_t>>>; enum class ShockType { - level, // The value is the level of the exogenous (“values” statement in “shocks”) + level, // The value is the level of the exogenous (“values” statement in “shocks”) multiplySteadyState, // The value is the ratio of the exogenous over its (terminal) steady state // (“values” statement in “mshocks”) multiplyInitialSteadyState // The value is the ratio of the exogenous over its initial steady @@ -128,8 +128,8 @@ public: enum class LearntShockType { level, // The value is the level of the exogenous (“values” statement in “shocks(learnt_in=…)”) - add, // The value is the additive change of the exogenous compared to previous information - // period (“add” statement in “shocks(learnt_in=…)”) + add, // The value is the additive change of the exogenous compared to previous information + // period (“add” statement in “shocks(learnt_in=…)”) multiply, // The value is the multiplicative change of the exogenous compared to previous // information period (“multiply” statement in “shocks(learnt_in=…)”) multiplySteadyState, // The value is the ratio of the exogenous over its (terminal) steady state -- GitLab