From ca84a51f867988cc4a6b3f4058ab6dc9f9badf84 Mon Sep 17 00:00:00 2001 From: Ivan Donchevskii Date: Wed, 29 Aug 2018 15:58:13 +0200 Subject: Clang: Use clang-format for indentation This is the new experimental plugin based on LibFormat. It replaces the default indenter for CppEditorDocument and applies clang-format after the CR or the set of 'electric' characters. Uses the global .clang-format kept in QtC settings or the one for current project. Both can be configured. For indentation some style modifications and code manipulations are done to prevent line shrinking when it's not expected. Manual indentation uses unmodified style from .clang-format file. Change-Id: I6279b805e418e1804b553efa615f5c843f395a58 Reviewed-by: Marco Bubke --- dist/clangformat/.clang-format | 115 ----------------------------------------- dist/clangformat/README.md | 22 ++------ 2 files changed, 4 insertions(+), 133 deletions(-) delete mode 100644 dist/clangformat/.clang-format (limited to 'dist/clangformat') diff --git a/dist/clangformat/.clang-format b/dist/clangformat/.clang-format deleted file mode 100644 index 25df05eb26..0000000000 --- a/dist/clangformat/.clang-format +++ /dev/null @@ -1,115 +0,0 @@ -# .clang-format for Qt Creator -# -# This is for clang-format >= 5.0. -# -# The configuration below follows the Qt Creator Coding Rules [1] as closely as -# possible. For documentation of the options, see [2]. -# -# Use ../../tests/manual/clang-format-for-qtc/test.cpp for documenting problems -# or testing changes. -# -# [1] https://doc-snapshots.qt.io/qtcreator-extending/coding-style.html -# [2] https://clang.llvm.org/docs/ClangFormatStyleOptions.html -# ---- -Language: Cpp -AccessModifierOffset: -4 -AlignAfterOpenBracket: Align -AlignConsecutiveAssignments: false -AlignConsecutiveDeclarations: false -AlignEscapedNewlines: DontAlign -AlignOperands: true -AlignTrailingComments: true -AllowAllParametersOfDeclarationOnNextLine: true -AllowShortBlocksOnASingleLine: false -AllowShortCaseLabelsOnASingleLine: false -AllowShortFunctionsOnASingleLine: Inline -AllowShortIfStatementsOnASingleLine: false -AllowShortLoopsOnASingleLine: false -AlwaysBreakAfterReturnType: None -AlwaysBreakBeforeMultilineStrings: false -AlwaysBreakTemplateDeclarations: true -BinPackArguments: false -BinPackParameters: false -BraceWrapping: - AfterClass: true - AfterControlStatement: false - AfterEnum: false - AfterFunction: true - AfterNamespace: false - AfterObjCDeclaration: false - AfterStruct: true - AfterUnion: false - BeforeCatch: false - BeforeElse: false - IndentBraces: false - SplitEmptyFunction: false - SplitEmptyRecord: false - SplitEmptyNamespace: false -BreakBeforeBinaryOperators: All -BreakBeforeBraces: Custom -BreakBeforeInheritanceComma: false -BreakBeforeTernaryOperators: true -BreakConstructorInitializersBeforeComma: false -BreakConstructorInitializers: BeforeComma -BreakAfterJavaFieldAnnotations: false -BreakStringLiterals: false -ColumnLimit: 100 -CommentPragmas: '^ IWYU pragma:' -CompactNamespaces: false -ConstructorInitializerAllOnOneLineOrOnePerLine: false -ConstructorInitializerIndentWidth: 4 -ContinuationIndentWidth: 4 -Cpp11BracedListStyle: true -DerivePointerAlignment: false -DisableFormat: false -ExperimentalAutoDetectBinPacking: false -FixNamespaceComments: true -ForEachMacros: - - forever # avoids { wrapped to next line - - foreach - - Q_FOREACH - - BOOST_FOREACH -IncludeCategories: - - Regex: '^