@@ -35,10 +35,44 @@ 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
+ # Print the changes to the console
63
+ cat clang-format-changes.patch
64
+ # if any changes were made, fail the build
65
+ if git diff --quiet ; then
66
+ # If no changes were made, delete the (empty) patch file, so it doesn't get posted as an artifact
67
+ rm -f clang-format-changes.patch
68
+ else
69
+ echo "Code misformatted. Run clang-format or apply the patch to fix."
70
+ exit 1
71
+ fi
72
+ - name : Upload artifacts
73
+ uses : actions/upload-artifact@v4
74
+ if : always()
75
+ with :
76
+ name : clang-format-changes.patch
77
+ path : |
78
+ clang-format-changes.patch
0 commit comments