diff --git a/.clang-format b/.clang-format index 43d5bcb90..f9837cc7f 100644 --- a/.clang-format +++ b/.clang-format @@ -7,11 +7,11 @@ AlignConsecutiveAssignments: false AlignConsecutiveDeclarations: false AlignEscapedNewlines: Right AlignOperands: false -AlignTrailingComments: false +AlignTrailingComments: true AllowAllParametersOfDeclarationOnNextLine: true -AllowShortBlocksOnASingleLine: false +AllowShortBlocksOnASingleLine: true AllowShortCaseLabelsOnASingleLine: false -AllowShortFunctionsOnASingleLine: All +AllowShortFunctionsOnASingleLine: None AllowShortIfStatementsOnASingleLine: false AllowShortLoopsOnASingleLine: false AlwaysBreakAfterDefinitionReturnType: None @@ -20,7 +20,7 @@ AlwaysBreakBeforeMultilineStrings: false AlwaysBreakTemplateDeclarations: MultiLine BinPackArguments: true BinPackParameters: true -BraceWrapping: +BraceWrapping: AfterClass: false AfterControlStatement: false AfterEnum: false @@ -56,12 +56,12 @@ DerivePointerAlignment: false DisableFormat: false ExperimentalAutoDetectBinPacking: false FixNamespaceComments: false -ForEachMacros: +ForEachMacros: - foreach - Q_FOREACH - BOOST_FOREACH IncludeBlocks: Preserve -IncludeCategories: +IncludeCategories: - Regex: '^"(llvm|llvm-c|clang|clang-c)/' Priority: 2 - Regex: '^(<|"(gtest|gmock|isl|json)/)' @@ -92,7 +92,7 @@ PenaltyBreakString: 1000 PenaltyBreakTemplateDeclaration: 10 PenaltyExcessCharacter: 1000000 PenaltyReturnTypeOnItsOwnLine: 60 -PointerAlignment: Left +PointerAlignment: Right ReflowComments: true SortIncludes: true SortUsingDeclarations: true diff --git a/format.sh b/format.sh index 66c6de538..5ea8eeed9 100755 --- a/format.sh +++ b/format.sh @@ -4,7 +4,7 @@ CPP_DONE="Source/doom.cpp Source/movie.cpp Source/pfile.cpp Source/player.cpp So for f in $CPP_DONE; do echo "Formatting $f" - clang-format -style="{BasedOnStyle: webkit, AlignTrailingComments: true, AllowShortBlocksOnASingleLine: true, AllowShortFunctionsOnASingleLine: None, PointerAlignment: Right}" -i $f + clang-format -style=file -i $f done H_DONE="enums.h structs.h"