-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclang-tidy.sh
executable file
·37 lines (32 loc) · 1.51 KB
/
clang-tidy.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
#!/bin/bash
# ------------------------------------------------------------------------------------------------ #
# #
# _) | | _) This code may be used and modified under the terms #
# | | | | | (_-< | _ \ \ of the MIT license. See the LICENSE file for details. #
# _| _| _| \_,_| ___/ _| \___/ _| _| Copyright (c) 2018-2019 Simon Schneegans #
# #
# ------------------------------------------------------------------------------------------------ #
# get the location of this script
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
FLAGS="-std=c++17 "
FLAGS+="-I${SCRIPT_DIR}/src "
FLAGS+="-I${SCRIPT_DIR}/externals/glm "
FLAGS+="-I${SCRIPT_DIR}/externals/gli "
FLAGS+="-I${SCRIPT_DIR}/externals/stb "
FLAGS+="-I${SCRIPT_DIR}/externals/tinygltf "
FLAGS+="-I${SCRIPT_DIR}/externals/glslang "
FLAGS+="-I${SCRIPT_DIR}/externals/spirv-cross "
FLAGS+="-I${SCRIPT_DIR}/externals/vulkan-headers/include "
FLAGS+="-I${SCRIPT_DIR}/externals/entt/src"
CHECKS="modernize-*,"
CHECKS+="bugprone-*,"
CHECKS+="google-*,"
CHECKS+="readability-*,"
CHECKS+="performance-*,"
CHECKS+="hicpp-*,"
CHECKS+="misc-*,"
# run clang-tidy on all source files
find src examples -iname "*.cpp"|while read file; do
echo "Tidying ${file}..."
clang-tidy-7 -checks=$CHECKS -fix -quiet $file -- $FLAGS
done