mirror of
https://github.com/hyprwm/Hyprland
synced 2025-01-10 17:29:49 +01:00
ci(clang-format): directly do the clang-format instead of error (#8955)
Will suggest a clang-format fix on every MR that violates it.
This commit is contained in:
parent
2d1ebadb9b
commit
85aba23cbe
1 changed files with 24 additions and 0 deletions
24
.github/workflows/ci.yaml
vendored
24
.github/workflows/ci.yaml
vendored
|
@ -126,3 +126,27 @@ jobs:
|
||||||
|
|
||||||
- name: clang-format check
|
- name: clang-format check
|
||||||
run: ninja -C build clang-format-check
|
run: ninja -C build clang-format-check
|
||||||
|
|
||||||
|
- name: clang-format apply
|
||||||
|
if: ${{ failure() && github.event_name == 'pull_request' }}
|
||||||
|
run: ninja -C build clang-format
|
||||||
|
|
||||||
|
- name: Create patch
|
||||||
|
if: ${{ failure() && github.event_name == 'pull_request' }}
|
||||||
|
run: |
|
||||||
|
echo 'Please fix the formatting issues by running [`clang-format`](https://wiki.hyprland.org/Contributing-and-Debugging/PR-Guidelines/#code-style), or directly apply this patch:' > clang-format.patch
|
||||||
|
echo '<details>' >> clang-format.patch
|
||||||
|
echo '<summary>clang-format.patch</summary>' >> clang-format.patch
|
||||||
|
echo >> clang-format.patch
|
||||||
|
echo '```diff' >> clang-format.patch
|
||||||
|
git diff >> clang-format.patch
|
||||||
|
echo '```' >> clang-format.patch
|
||||||
|
echo >> clang-format.patch
|
||||||
|
echo '</details>' >> clang-format.patch
|
||||||
|
|
||||||
|
- name: Comment patch
|
||||||
|
if: ${{ failure() && github.event_name == 'pull_request' }}
|
||||||
|
uses: mshick/add-pr-comment@v2
|
||||||
|
with:
|
||||||
|
message-path: |
|
||||||
|
clang-format.patch
|
||||||
|
|
Loading…
Reference in a new issue