@@ -35,10 +35,42 @@ jobs:
35
35
36
36
- name : Run clang-format
37
37
run : |
38
- .github/scripts/run-clang-format.py -r Source Data/Base.rte/Shaders \
38
+ .github/scripts/run-clang-format.py \
39
+ -i \
40
+ -r Source Data/Base.rte/Shaders \
39
41
--exclude Source/System/Base64 \
40
42
--exclude Source/System/BitMask \
41
43
--exclude Source/System/glad \
42
44
--exclude Source/System/MicroPather \
43
45
--exclude Source/System/Semver200 \
44
46
--exclude Source/System/StackWalker
47
+ - name : Add missing newlines
48
+ run : |
49
+ .github/scripts/run-clang-format.py \
50
+ -i --clang-format-executable .github/scripts/add-eol.sh \
51
+ -r Source Data/Base.rte/Shaders \
52
+ --exclude Source/System/Base64 \
53
+ --exclude Source/System/BitMask \
54
+ --exclude Source/System/glad \
55
+ --exclude Source/System/MicroPather \
56
+ --exclude Source/System/Semver200 \
57
+ --exclude Source/System/StackWalker
58
+ - name : Report changes
59
+ run : |
60
+ # Store the changes in a patch file first
61
+ git diff > clang-format-changes.patch
62
+ # if any changes were made, fail the build
63
+ if ! git diff --quiet ; then
64
+ echo "::error::Code misformatted. Run clang-format or apply the patch (printed below and attached to job summary) to fix."
65
+ # Print the changes to the console
66
+ cat clang-format-changes.patch
67
+ exit 1
68
+ fi
69
+ - name : Upload artifacts
70
+ uses : actions/upload-artifact@v4
71
+ # Only upload the patch file if the build failed, meaning that the code was not properly formatted
72
+ if : failure()
73
+ with :
74
+ name : clang-format-changes.patch
75
+ path : |
76
+ clang-format-changes.patch
0 commit comments