From 0fb69a15e81bd2f8d8dc213b748d1c1feada336d Mon Sep 17 00:00:00 2001 From: Jonas Rembser <jonas.rembser@cern.ch> Date: Mon, 23 Jan 2023 18:06:21 +0100 Subject: [PATCH] Change `clang-format` style to have line breaks in c'tor initializer We use the `clang-format` style of ROOT for all the new source files in RooFit, but some code looks pretty ugly. For example, here in the constructor of `RooNLLVarNer`: ```C++ RooNLLVarNew::RooNLLVarNew(const char *name, const char *title, RooAbsPdf &pdf, RooArgSet const &observables, bool isExtended, RooFit::OffsetMode offsetMode, bool binnedL) : RooAbsReal(name, title), _pdf{"pdf", "pdf", this, pdf}, _observables{getObs(pdf, observables)}, _isExtended{isExtended}, _binnedL{binnedL}, _weightVar{"weightVar", "weightVar", this, *dummyVar(weightVarName), true, false, true}, ... ``` Really not great to have all the elements in the constructor initializer list in one line. It's hard to read, there are weird line breaks, and if you only change one member it looks like you have changed everything. This commit suggests to have line breaks in the style instead, so from now on, it will look better. --- .clang-format | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.clang-format b/.clang-format index 9d4c30fcb5b..acefcdd85ca 100644 --- a/.clang-format +++ b/.clang-format @@ -38,7 +38,7 @@ BreakBeforeTernaryOperators: true BreakConstructorInitializersBeforeComma: false ColumnLimit: 120 CommentPragmas: '^ IWYU pragma:' -ConstructorInitializerAllOnOneLineOrOnePerLine: false +ConstructorInitializerAllOnOneLineOrOnePerLine: true ConstructorInitializerIndentWidth: 3 ContinuationIndentWidth: 3 Cpp11BracedListStyle: true -- GitLab