Commit ae906fe8 authored by Adriaan de Groot's avatar Adriaan de Groot 💬 Committed by Jonathan Marten
Browse files

Add a clang-format file

This format is copied from kquickcharts, one of the few KDE
projects to have such a formatting file. It is WebKit-ish,
so it matches the KDE Frameworks style fairly well.

While here, match the .editorconfig line length with the
clang-format one.
parent a7510846
BasedOnStyle: WebKit
Language: Cpp
Standard: Cpp11
# Align pointer to the right.
PointerAlignment: Right
# As a base rule, the left curly brace goes on the same line as the start of the
# statement, except function implementations, classes, structs, and namespace
# declarations.
BreakBeforeBraces: Custom
AfterClass: true
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: false
AfterStruct: true
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
# Macros that should be interpreted as foreach loops instead of as function calls.
- foreach
- forever
# Each include section has to be sorted.
SortIncludes: true
# Case labels are on the same column as the switch.
IndentCaseLabels: false
# Don't indent in namespaces.
NamespaceIndentation: None
# The maximum number of consecutive empty lines to keep.
MaxEmptyLinesToKeep: 1
# Break before operators that aren't assignments.
BreakBeforeBinaryOperators: NonAssignment
# Treat C++11 braced initialization like all other initialization
Cpp11BracedListStyle: true
SpaceBeforeCpp11BracedList: false
BreakConstructorInitializers: BeforeComma
AlignAfterOpenBracket: AlwaysBreak
BinPackArguments: false
ColumnLimit: 150
AllowShortFunctionsOnASingleLine: None
......@@ -7,7 +7,7 @@ end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
max_line_length = 100
max_line_length = 150
trim_trailing_whitespace = true
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment