diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000000000..d49333055eeaf --- /dev/null +++ b/.clang-format @@ -0,0 +1,20 @@ +BasedOnStyle: Google +BreakBeforeBraces: Linux +IndentWidth: 4 +PPIndentWidth: 1 +IndentPPDirectives: AfterHash +IndentCaseLabels: false +IncludeBlocks: Preserve +SortIncludes: true +SpaceAfterCStyleCast: false +AllowShortIfStatementsOnASingleLine : Never +AllowShortLoopsOnASingleLine: false +AllowShortFunctionsOnASingleLine: false +AlignArrayOfStructures: Right +AlignConsecutiveAssignments: true +AllowAllParametersOfDeclarationOnNextLine: false +Cpp11BracedListStyle: true +InsertNewlineAtEOF: true +SpacesInContainerLiterals: false +BinPackArguments: true +BinPackParameters: true diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 3aece2f4d71b1..8fdd3c54dd64e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -39,3 +39,16 @@ jobs: steps: - uses: actions/checkout@v4 - uses: chartboost/ruff-action@v1 + + clang-format-lint: + runs-on: ubuntu-24.04 + container: + image: "registry.opensuse.org/home/mia/images/images/mpv-ci:stable-deps" + if: github.event_name == 'pull_request' + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 50 + - name: Check Formatting + run: | + git clang-format ${{ github.event.pull_request.base.sha }} --diff