mirror of https://github.com/kiwix/libkiwix.git
Merge pull request #822 from kiwix/update-format-code-script
Update format_code.sh script
This commit is contained in:
commit
f6ae75e41d
|
@ -1,38 +0,0 @@
|
||||||
#!/usr/bin/bash
|
|
||||||
|
|
||||||
files=(
|
|
||||||
"include/library.h"
|
|
||||||
"include/common/stringTools.h"
|
|
||||||
"include/common/pathTools.h"
|
|
||||||
"include/common/otherTools.h"
|
|
||||||
"include/common/regexTools.h"
|
|
||||||
"include/common/networkTools.h"
|
|
||||||
"include/common/archiveTools.h"
|
|
||||||
"include/manager.h"
|
|
||||||
"include/reader.h"
|
|
||||||
"include/kiwix.h"
|
|
||||||
"include/xapianSearcher.h"
|
|
||||||
"include/searcher.h"
|
|
||||||
"src/library.cpp"
|
|
||||||
"src/android/kiwix.cpp"
|
|
||||||
"src/android/org/kiwix/kiwixlib/JNIKiwixBool.java"
|
|
||||||
"src/android/org/kiwix/kiwixlib/JNIKiwix.java"
|
|
||||||
"src/android/org/kiwix/kiwixlib/JNIKiwixString.java"
|
|
||||||
"src/android/org/kiwix/kiwixlib/JNIKiwixInt.java"
|
|
||||||
"src/searcher.cpp"
|
|
||||||
"src/common/pathTools.cpp"
|
|
||||||
"src/common/regexTools.cpp"
|
|
||||||
"src/common/otherTools.cpp"
|
|
||||||
"src/common/archiveTools.cpp"
|
|
||||||
"src/common/networkTools.cpp"
|
|
||||||
"src/common/stringTools.cpp"
|
|
||||||
"src/xapianSearcher.cpp"
|
|
||||||
"src/manager.cpp"
|
|
||||||
"src/reader.cpp"
|
|
||||||
)
|
|
||||||
|
|
||||||
for i in "${files[@]}"
|
|
||||||
do
|
|
||||||
echo $i
|
|
||||||
clang-format -i -style=file $i
|
|
||||||
done
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
#!/usr/bin/bash
|
||||||
|
|
||||||
|
# Compute 'src' path
|
||||||
|
SCRIPT_DIR=$(dirname "$0")
|
||||||
|
REPO_DIR=$(readlink -f "$SCRIPT_DIR"/..)
|
||||||
|
DIRS="src include"
|
||||||
|
|
||||||
|
# Apply formating to all *.cpp and *.h files
|
||||||
|
cd "$REPO_DIR"
|
||||||
|
for FILE in $(find $DIRS -name '*.h' -o -name '*.cpp')
|
||||||
|
do
|
||||||
|
echo $FILE
|
||||||
|
clang-format -i -style=file "$FILE"
|
||||||
|
done
|
Loading…
Reference in New Issue