feat: Use clang-format to keep the C++ codebase clean (#1741)
* Use clang-format * Create .clang-format * Update .clang-format * Update .clang-format * Update .clang-format * Only search in cpp dirs * Update clang-format.sh * Update .clang-format * Update .clang-format * Update .clang-format * Format C++ code! * Use version 16 * Update clang-format.sh * Remove Shaders.ts * fix: Lint Swift
This commit is contained in:
@@ -9,8 +9,8 @@ echo "Linting Swift code.."
|
||||
echo "Linting Kotlin code.."
|
||||
./scripts/ktlint.sh
|
||||
|
||||
echo "Linting C++ code.."
|
||||
./scripts/cpplint.sh
|
||||
echo "Formatting C++ code.."
|
||||
./scripts/clang-format.sh
|
||||
|
||||
echo "Linting JS/TS code.."
|
||||
yarn lint --fix
|
||||
|
||||
10
scripts/clang-format.sh
Executable file
10
scripts/clang-format.sh
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
if which clang-format >/dev/null; then
|
||||
find cpp ios android/src/main/cpp -type f \( -name "*.h" -o -name "*.cpp" -o -name "*.m" -o -name "*.mm" \) -print0 | while read -d $'\0' file; do
|
||||
echo "-> cpp-lint $file"
|
||||
clang-format -i "$file"
|
||||
done
|
||||
else
|
||||
echo "warning: clang-format not installed, download from https://clang.llvm.org/docs/ClangFormat.html (or run brew install clang-format)"
|
||||
fi
|
||||
@@ -1,7 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
if which cpplint >/dev/null; then
|
||||
cpplint --linelength=230 --filter=-legal/copyright,-readability/todo,-build/namespaces,-runtime/references,-whitespace/comments,-build/include_order,-build/c++11 --quiet --recursive cpp android/src/main/cpp
|
||||
else
|
||||
echo "warning: cpplint not installed, download from https://github.com/cpplint/cpplint"
|
||||
fi
|
||||
Reference in New Issue
Block a user