Reviewers: , Message: It's worth emphasizing this: even with these improvements to the clang-format configuration, those who use clang-format will introduce a truckload of differences from the traditional indentation.
Description: https://sourceforge.net/p/testlilyissues/issues/5862/ Prefer astyle 3.1 and update clang-format options Change the preferred version of astyle from 2.04 to 3.1. In a separate commit, add a few clang-format options to reduce (slightly) the extent of changes that a subsequent fixcc.py makes. Test procedure: 1. clang-format everything (version 9.0.0) 2. git commit 3. fixcc.py everything (astyle version 3.1) 4. git diff | wc -l BASELINE LINES master@786c3669ff08804465a89013d349fc745fd783c9 19702 BENEFICIAL OPTIONS (TESTED INDIVIDUALLY) LINES ConstructorInitializerIndentWidth: 2 19062 ContinuationIndentWidth: 2 15018 SpaceAfterCStyleCast: true 19540 [Tested together] 14171 OTHER OPTIONS (TESTED INDIVIDUALLY) LINES AlignEscapedNewlines: Left 19702 AlignOperands: false 20760 AllowShortFunctionsOnASingleLine: InlineOnly 19708 AlwaysBreakTemplateDeclarations: MultiLine 19702 BinPackArguments: false 21588 BinPackParameters: false 20557 BreakBeforeTernaryOperators: true 19702 BreakConstructorInitializers: BeforeColon 19702 BreakInheritanceList: BeforeColon 19702 ColumnLimit: 80 19702 SortIncludes: false 19702 SpaceAfterTemplateKeyword: false 19702 Please review this at https://codereview.appspot.com/551640043/ Affected files (+4, -1 lines): M .clang-format M scripts/auxiliar/fixcc.py Index: .clang-format diff --git a/.clang-format b/.clang-format index db078d01eacd53ae8c1da39186048641d12be7bf..126312d446f4dfbba9e2b162ac08572b60914324 100644 --- a/.clang-format +++ b/.clang-format @@ -7,6 +7,9 @@ Language: Cpp AlwaysBreakAfterReturnType: TopLevelDefinitions BreakBeforeBinaryOperators: All BreakBeforeBraces: GNU +ConstructorInitializerIndentWidth: 2 +ContinuationIndentWidth: 2 +SpaceAfterCStyleCast: true SpaceBeforeParens: Always ReflowComments: false ... Index: scripts/auxiliar/fixcc.py diff --git a/scripts/auxiliar/fixcc.py b/scripts/auxiliar/fixcc.py index abb5272bc921e8ba496005556f5028272b312935..0c4324234e079b750e9fba07fa92cb05ffe3001d 100755 --- a/scripts/auxiliar/fixcc.py +++ b/scripts/auxiliar/fixcc.py @@ -38,7 +38,7 @@ GLOBAL_CXX = 'GC++' CXX = 'C++' verbose_p = 0 indent_p = 1 -PREFERRED_ASTYLE_VERSION = "Artistic Style Version 2.04" +PREFERRED_ASTYLE_VERSION = "Artistic Style Version 3.1" rules = {