Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workflows/lint: add clang-format on changed files #15132

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
Language: Cpp
BasedOnStyle: Google
IndentWidth: 4
PPIndentWidth: 1
IndentPPDirectives: AfterHash
IndentCaseLabels: false
IncludeBlocks: Preserve
SortIncludes: true
Dudemanguy marked this conversation as resolved.
Show resolved Hide resolved
SpaceAfterCStyleCast: false
AllowShortIfStatementsOnASingleLine : Never
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: false
AlignConsecutiveMacros: true
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
Cpp11BracedListStyle: false
InsertNewlineAtEOF: true
SpacesInContainerLiterals: false
BinPackArguments: true
BinPackParameters: true
AlignAfterOpenBracket: Align
BracedInitializerIndentWidth: 4
SeparateDefinitionBlocks: Always
BreakBeforeBraces: Custom
AllowShortCaseLabelsOnASingleLine: true
BraceWrapping:
AfterControlStatement: MultiLine
AfterCaseLabel: false
AfterEnum: true
AfterFunction: true
AlignConsecutiveAssignments:
Enabled: true
AcrossEmptyLines: false
AcrossComments: false
PackConstructorInitializers: Never
BreakConstructorInitializers: BeforeComma
---
12 changes: 12 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,15 @@ jobs:
- uses: actions/checkout@v4
- uses: editorconfig-checker/action-editorconfig-checker@main
- run: editorconfig-checker -config .editorconfig-checker.json

clang-format-lint:
runs-on: ubuntu-latest
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
Loading