diff --git a/.clang-format b/.clang-format index 707370d54..4f7330b71 100644 --- a/.clang-format +++ b/.clang-format @@ -1,7 +1,26 @@ +# Settings tested with clang-format 16 + AccessModifierOffset: -4 +AllowShortBlocksOnASingleLine: Always AllowShortFunctionsOnASingleLine: None AllowShortIfStatementsOnASingleLine: true -BreakBeforeBraces: Allman +BreakBeforeBraces: Custom +BraceWrapping: + AfterEnum: true + AfterClass: true + AfterCaseLabel: true + AfterStruct: true + AfterUnion: true + AfterExternBlock: true + AfterObjCDeclaration: true + AfterFunction: true + AfterNamespace: true + AfterControlStatement: Always + BeforeCatch: true + BeforeElse: true + BeforeWhile: false + SplitEmptyFunction: true + BeforeLambdaBody: false BreakConstructorInitializers: BeforeComma ColumnLimit: 0 FixNamespaceComments: false @@ -10,6 +29,9 @@ NamespaceIndentation: All PointerBindsToType: true SortIncludes: false SpaceBeforeParens: Never -Standard: Cpp11 +Standard: c++17 +SpacesInLineCommentPrefix: + Minimum: 0 + Maximum: -1 TabWidth: 4 UseTab: ForIndentation diff --git a/.github/workflows/check-format.yaml b/.github/workflows/check-format.yaml index 126e26773..22d74d35b 100644 --- a/.github/workflows/check-format.yaml +++ b/.github/workflows/check-format.yaml @@ -6,12 +6,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: DoozyX/clang-format-lint-action@v0.11 + - uses: DoozyX/clang-format-lint-action@v0.16.2 with: source: './Source ./tools' exclude: './Source/ui_qt/win32/Resources ./Source/ui_libretro/ext' extensions: 'h,cpp,c,m,mm' - clangFormatVersion: 6 + clangFormatVersion: 16 inplace: True - name: Check for changes run: |