-
Notifications
You must be signed in to change notification settings - Fork 1
/
run_clang_tidy_on_project.sh
78 lines (72 loc) · 2.38 KB
/
run_clang_tidy_on_project.sh
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/bash
# Script to run clang-tidy automated checks and fixes. To omit a line use //NOLINT
projectFiles=()
set_project_files () {
for entry in $1
do
if [ ! -d "$entry" ]; then
projectFiles+=($entry)
fi
done
}
set_project_files "./apps/main.cpp"
set_project_files "./src/core/*"
set_project_files "./src/core/core_execution/*"
set_project_files "./src/core/core_input/*"
set_project_files "./src/core_interfaces/*"
set_project_files "./src/dbmstodspi/input_handling/*"
set_project_files "./src/dbmstodspi/query_execution/*"
set_project_files "./src/dbmstodspi/query_execution/fpga_managing/*"
set_project_files "./src/dbmstodspi/query_execution/fpga_managing/modules/*"
set_project_files "./src/dbmstodspi/query_execution/fpga_managing/setup/*"
set_project_files "./src/dbmstodspi/query_execution/scheduling/*"
set_project_files "./src/dbmstodspi/query_execution/states/*"
set_project_files "./src/dbmstodspi/query_execution/table_data/*"
set_project_files "./src/dbmstodspi/util/*"
set_project_files "./tests/core/*"
set_project_files "./tests/core/core_execution/*"
set_project_files "./tests/core/core_input/*"
set_project_files "./tests/core_interfaces/*"
set_project_files "./tests/dbmstodspi/input_handling/*"
set_project_files "./tests/dbmstodspi/query_execution/*"
set_project_files "./tests/dbmstodspi/query_execution/fpga_managing/*"
set_project_files "./tests/dbmstodspi/query_execution/fpga_managing/modules/*"
set_project_files "./tests/dbmstodspi/query_execution/fpga_managing/setup/*"
set_project_files "./tests/dbmstodspi/query_execution/scheduling/*"
set_project_files "./tests/dbmstodspi/query_execution/states/*"
set_project_files "./tests/dbmstodspi/query_execution/table_data/*"
set_project_files "./tests/dbmstodspi/util/*"
tempArray=()
for file in ${projectFiles[@]}
do
if [[ "$file" != *".txt" ]]
then
tempArray+=($file)
fi
done
projectFiles=("${tempArray[@]}")
unset tempArray
checks=(
modernize-*
google-*
cppcoreguidelines-*
bugprone-*
readability-*
misc-*
performance-*
portability-*
)
for file in ${projectFiles[@]}
do
echo $file
for check in ${checks[@]}
do
echo $check
clang-tidy --checks="-*,$check" --fix-errors --quiet -p=C://Users//Kaspar//source//repos//DBMStoDSPI//out//build//Local\ PC $file
echo
done
echo
done
echo "Automatic fixes done!"
clang-format -i -style=google **/*.cpp **/*.hpp
echo "Formatting done!"