From 0b27ee6df7588a1a1a7c86a888498ffa50b0e115 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Nicole?= Date: Mon, 26 Feb 2018 10:56:26 +0100 Subject: Add some configuration files for code style tooling Summary: Tools: - [EditorConfig](http://editorconfig.org/) - [Clang Format](https://clang.llvm.org/docs/ClangFormat.html) Code style: - ClangFormat taken from Sink's configuration with small modifications: - max width set to 100 characters - do not pack arguments and initializer list elements - no space inside brace lists - EditorConfig: UNIX style text files, 4 spaces for indentation Reviewers: cmollekopf Reviewed By: cmollekopf Tags: #kube Differential Revision: https://phabricator.kde.org/D10740 --- .clang-format | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ .editorconfig | 9 +++++++++ 2 files changed, 61 insertions(+) create mode 100644 .clang-format create mode 100644 .editorconfig diff --git a/.clang-format b/.clang-format new file mode 100644 index 00000000..c20132d8 --- /dev/null +++ b/.clang-format @@ -0,0 +1,52 @@ +AccessModifierOffset: -4 +AlignEscapedNewlinesLeft: true +AlignTrailingComments: false +AlignAfterOpenBracket: false +AllowAllParametersOfDeclarationOnNextLine: true +AllowShortBlocksOnASingleLine: false +AllowShortFunctionsOnASingleLine: Empty +AllowShortIfStatementsOnASingleLine: false +AllowShortLoopsOnASingleLine: false +AlwaysBreakAfterDefinitionReturnType: false +AlwaysBreakBeforeMultilineStrings: false +AlwaysBreakTemplateDeclarations: true +BinPackArguments: false +BinPackParameters: true +BreakBeforeBinaryOperators: false +BreakBeforeBraces: Mozilla +BreakBeforeTernaryOperators: false +BreakConstructorInitializersBeforeComma: false +ColumnLimit: 100 +CommentPragmas: '' +ConstructorInitializerAllOnOneLineOrOnePerLine: true +ConstructorInitializerIndentWidth: 4 +ContinuationIndentWidth: 4 +Cpp11BracedListStyle: true +DerivePointerBinding: false +ForEachMacros: ['foreach', 'Q_FOREACH', 'QBENCHMARK'] +IndentCaseLabels: true +IndentFunctionDeclarationAfterType: false +IndentWidth: 4 +Language: Cpp +MaxEmptyLinesToKeep: 2 +NamespaceIndentation: None +ObjCSpaceAfterProperty: true +ObjCSpaceBeforeProtocolList: true +PenaltyBreakBeforeFirstCallParameter: 100 +PenaltyBreakComment: 100 +PenaltyBreakFirstLessLess: 0 +PenaltyBreakString: 100 +PenaltyExcessCharacter: 1 +PenaltyReturnTypeOnItsOwnLine: 0 +PointerBindsToType: false +SpaceBeforeAssignmentOperators: true +SpaceBeforeParens: ControlStatements +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 1 +SpacesInAngles: false +SpacesInCStyleCastParentheses: false +SpacesInContainerLiterals: false +SpacesInParentheses: false +Standard: Cpp11 +TabWidth: 4 +UseTab: Never diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..65b13306 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +insert_final_newline = true +charset = utf-8 +trim_trailing_whitespace = true -- cgit v1.2.3