mirror of
https://github.com/zeldaret/tp
synced 2026-05-23 06:54:28 -04:00
fix clang-format check
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
---
|
||||
Language: Cpp
|
||||
Standard: c++03
|
||||
Standard: C++03
|
||||
AccessModifierOffset: -4
|
||||
AlignAfterOpenBracket: Align
|
||||
AlignConsecutiveAssignments: false
|
||||
|
||||
@@ -8,8 +8,8 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: DoozyX/clang-format-lint-action@v0.11
|
||||
with:
|
||||
source: '.'
|
||||
extensions: 'h,cpp'
|
||||
clangFormatVersion: 11
|
||||
- name: Install clang-format
|
||||
run: sudo apt-get install clang-format-10
|
||||
- name: Run clang-format-check
|
||||
run: sh tools/clang-format-check.sh
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
clangFormatTargets=$(find . -type f -regex '.*\.\(cpp\|hpp\|h\|cc\|cxx\)')
|
||||
|
||||
for inputFile in $clangFormatTargets
|
||||
do
|
||||
clang-format-10 -style=file $inputFile > $inputFile-formatted
|
||||
diff $inputFile $inputFile-formatted
|
||||
if [ $? != 0 ] ; then
|
||||
exit 1
|
||||
else
|
||||
rm $inputFile-formatted
|
||||
fi
|
||||
done
|
||||
Reference in New Issue
Block a user