forked from cosmoscout/cosmoscout-vr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclang-format.sh
executable file
·22 lines (18 loc) · 996 Bytes
/
clang-format.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
# ------------------------------------------------------------------------------------------------ #
# This file is part of CosmoScout VR #
# ------------------------------------------------------------------------------------------------ #
# SPDX-FileCopyrightText: German Aerospace Center (DLR) <[email protected]>
# SPDX-License-Identifier: MIT
# The src/, resources/, tools/ and the plugins/ directory is assumed to reside one directory above
# this script.
SRC_DIR="$( cd "$( dirname "$0" )" && pwd )"
# Execute clang format for all *.cpp, *.hpp and *.inl files.
find "$SRC_DIR/../src" "$SRC_DIR/../plugins" "$SRC_DIR/../resources" "$SRC_DIR/../tools" -type f \
\( -name '*.cpp' -o -name '*.hpp' -o -name '*.inl' -o \
-name '*.cu' -o -name '*.cuh' -o -name '*.js' \) -and ! -path '*third-party*' -exec sh -c '
for file do
echo "Formatting $file..."
clang-format -i "$file"
done
' sh {} +