-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathformat_code.bat
More file actions
44 lines (32 loc) · 1.28 KB
/
format_code.bat
File metadata and controls
44 lines (32 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
@echo off
pushd "%~dp0"
echo Formatting Code....
clang-format -i app\src\*.cpp || goto error
clang-format -i app\inc\*.hpp || goto error
clang-format -i test\*.cpp || goto error
clang-format -i zebral\camera\src\*.cpp || goto error
clang-format -i zebral\camera\inc\*.hpp || goto error
clang-format -i zebral\camera\test\*.cpp || goto error
clang-format -i zebral\common\src\*.cpp || goto error
clang-format -i zebral\common\inc\*.hpp || goto error
clang-format -i zebral\common\test\*.cpp || goto error
clang-format -i zebral\serial\src\*.cpp || goto error
clang-format -i zebral\serial\inc\*.hpp || goto error
clang-format -i zebral\serial\test\*.cpp || goto error
echo Formatting CMake...
cmake-format -i CMakeLists.txt || goto error
cmake-format -i app\CMakeLists.txt || goto error
cmake-format -i test\CMakeLists.txt || goto error
cmake-format -i zebral\camera\CMakeLists.txt || goto error
cmake-format -i zebral\camera\test\CMakeLists.txt || goto error
cmake-format -i zebral\common\CMakeLists.txt || goto error
cmake-format -i zebral\common\test\CMakeLists.txt || goto error
cmake-format -i zebral\serial\CMakeLists.txt || goto error
cmake-format -i zebral\serial\test\CMakeLists.txt || goto error
echo "Reformatted everything."
exit /b 0
popd
:error
echo "An error occurred!"
popd
exit /b 1