Skip to content

Commit 253285c

Browse files
committed
workflows/lint: add clang-format on changed files
The entire codebase is not ready to be clang-formatted and probably never will be, but we can at least check if the changes in new pull requests follow our coding style.
1 parent 37159a8 commit 253285c

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

.github/workflows/lint.yml

+21
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,24 @@ jobs:
3939
steps:
4040
- uses: actions/checkout@v4
4141
- uses: chartboost/ruff-action@v1
42+
43+
clang-format-lint:
44+
runs-on: ubuntu-latest
45+
if: github.event_name == 'pull_request'
46+
container:
47+
image: alpine:latest
48+
# container:
49+
# image: "registry.opensuse.org/home/mia/images/images/mpv-ci:stable-deps"
50+
steps:
51+
- run: |
52+
apk update
53+
apk add clang-format
54+
55+
- uses: actions/checkout@v4
56+
with:
57+
fetch-depth: 50
58+
- name: Check Formatting
59+
shell: bash
60+
run: |
61+
git clang-format ${{ github.event.pull_request.base.sha }} --diff
62+
echo $?

0 commit comments

Comments
 (0)