Skip to content

Commit

Permalink
clang-format: Update format definition file
Browse files Browse the repository at this point in the history
Update language standard to C++20- Our CMake config says we use that, so I
think it makes sense to format to that standard as well. This is
technically a downgrade though: The Cpp11 we used before is actually an alias
to "Latest", not to "c++11"!.

Update some options to newer syntax (clang-format 3.11 or later).
  • Loading branch information
hunger authored and ogoffart committed Jun 15, 2023
1 parent ffc4a44 commit ef82edc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# Webkit style was loosely based on the Qt style
BasedOnStyle: WebKit

Standard: Cpp11
Standard: "c++20"

# Column width is limited to 100 in accordance with Qt Coding Style.
# https://wiki.qt.io/Qt_Coding_Style
Expand All @@ -37,7 +37,7 @@ BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: Custom
BraceWrapping:
AfterClass: true
AfterControlStatement: false
AfterControlStatement: Never
AfterEnum: false
AfterFunction: true
AfterNamespace: false
Expand Down Expand Up @@ -65,8 +65,8 @@ IndentPPDirectives: AfterHash
# Horizontally align arguments after an open bracket.
# The coding style does not specify the following, but this is what gives
# results closest to the existing code.
AlignAfterOpenBracket: true
AlwaysBreakTemplateDeclarations: true
AlignAfterOpenBracket: "Align"
AlwaysBreakTemplateDeclarations: "Yes"

# Ideally we should also allow less short function in a single line, but
# clang-format does not handle that.
Expand All @@ -76,7 +76,7 @@ AllowShortFunctionsOnASingleLine: Inline
# separate categories with an empty line. It does not specify the order within
# the categories. Since the SortInclude feature of clang-format does not
# re-order includes separated by empty lines, the feature is not used.
SortIncludes: false
SortIncludes: "Never"

# macros for which the opening brace stays attached.
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH, forever, Q_FOREVER, QBENCHMARK, QBENCHMARK_ONCE ]
Expand Down

0 comments on commit ef82edc

Please sign in to comment.