mirror of
https://github.com/yse/easy_profiler.git
synced 2024-12-25 23:40:51 +08:00
Add .clang-format file and script for styling
This commit is contained in:
parent
84a86a7933
commit
86be4c9d59
9
.clang-format
Normal file
9
.clang-format
Normal file
@ -0,0 +1,9 @@
|
||||
---
|
||||
Language: Cpp
|
||||
BasedOnStyle: Google
|
||||
ColumnLimit: 100
|
||||
IndentWidth: 4
|
||||
ReflowComments: false
|
||||
#IndentPPDirectives: PPDIS_AfterHash #since clang 6.0
|
||||
...
|
||||
|
19
scripts/make_style.sh
Executable file
19
scripts/make_style.sh
Executable file
@ -0,0 +1,19 @@
|
||||
if [ "$#" -ne 1 ]; then
|
||||
echo -e "Usage: \n$0 DIRECTORY\n\twhere DIRECTORY is a derectory with sources for styling"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! [ -x "$(command -v clang-format)" ]; then
|
||||
echo 'Error: clang-format is not installed. Please install clang-format with minimal version 3.8' >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DIR=$1
|
||||
|
||||
FILES=`find $DIR -name "*.h" -or -name "*.cpp"`
|
||||
|
||||
for FILE in $FILES
|
||||
do
|
||||
echo "Set style for $FILE"
|
||||
clang-format -i $FILE
|
||||
done
|
Loading…
x
Reference in New Issue
Block a user