File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77 - ' **.cpp'
88 - ' **.h'
99 - ' !src/libs/**'
10+ - ' !src/FreeRTOS/**'
1011
1112jobs :
1213 test-format :
1819
1920 - name : Configure git
2021 run : |
21- git config --global user.email "-"
22- git config --global user.name "Autoformatter"
2322 git fetch origin "$GITHUB_BASE_REF":"$GITHUB_BASE_REF" --depth=1000
2423
2524 - name : Install clang-format
Original file line number Diff line number Diff line change @@ -16,18 +16,17 @@ for file in $CHANGED_FILES
1616do
1717 [ -e " $file " ] || continue
1818 case " $file " in
19- src/libs/* ) continue ;;
19+ src/libs/* |src/FreeRTOS/ * ) continue ;;
2020 * .cpp|* .h)
2121 echo Checking " $file "
22- clang-format -i " $file "
23- if ! git diff --quiet
22+ PATCH=" $( basename " $file " ) .patch"
23+ git clang-format-12 -q --style file --diff " $GITHUB_BASE_REF " " $file " > " $PATCH "
24+ if [ -s " $PATCH " ]
2425 then
2526 printf " \033[31mError:\033[0m Formatting error in %s\n" " $file "
2627 CHANGED=1
27- git add " $file "
28- git commit -q -m " Apply clang-format to $( basename " $file " ) "
29- printf " Creating patch "
30- git format-patch HEAD~
28+ else
29+ rm " $PATCH "
3130 fi
3231 esac
3332done
You can’t perform that action at this time.
0 commit comments