Skip to content

Commit 714f460

Browse files
committed
chore: fix ci
1 parent 49c849d commit 714f460

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

.github/workflows/validate-cpp.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ jobs:
3131
- name: Run clang-format style check
3232
uses: mrousavy/clang-format-action@v1
3333
with:
34-
clang-format-version: "16"
34+
clang-format-version: "18"
3535
check-path: ${{ matrix.path }}
3636
clang-format-style-path: package/.clang-format

package/package.json

+4-6
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,14 @@
3535
"test": "jest",
3636
"typescript": "tsc --noEmit",
3737
"lint": "eslint \"**/*.{js,ts,tsx}\"",
38-
"prepack": "bob build",
3938
"release": "release-it",
4039
"example": "yarn --cwd example",
4140
"bootstrap": "yarn example && yarn install && yarn example pods",
4241
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build",
43-
"clang-format": "yarn clang-format-ios && yarn clang-format-android && yarn clang-format-common",
44-
"clang-format-ios": "find ios -iname *.h -o -iname *.m -o -iname *.mm -o -iname *.cpp | xargs clang-format -style=file:./.clang-format -i",
45-
"clang-format-android": "find android/src -iname *.h -o -iname *.m -o -iname *.mm -o -iname *.cpp | xargs clang-format -style=file:./.clang-format -i",
46-
"clang-format-common": "find cpp -iname *.h -o -iname *.m -o -iname *.mm -o -iname *.cpp | xargs clang-format -style=file:./.clang-format -i",
47-
"cpplint": "cpplint --linelength=350 --filter=-legal/copyright,-whitespace/indent,-whitespace/comments,-whitespace/ending_newline,-build/include_order,-runtime/references,-readability/todo,-whitespace/blank_line,-whitespace/todo,-runtime/int,-build/c++11,-whitespace/parens --exclude=./node_modules --recursive cpp"
42+
"check-cpp": "scripts/clang-format.sh",
43+
"cpplint": "cpplint --linelength=350 --filter=-legal/copyright,-whitespace/indent,-whitespace/comments,-whitespace/ending_newline,-build/include_order,-runtime/references,-readability/todo,-whitespace/blank_line,-whitespace/todo,-runtime/int,-build/c++11,-whitespace/parens --exclude=./node_modules --recursive cpp",
44+
"prepack": "bob build && cp ../README.md ./README.md",
45+
"postpack": "rm ./README.md"
4846
},
4947
"keywords": [
5048
"react-native",

package/scripts/clang-format.sh

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
if which clang-format >/dev/null; then
4+
find cpp ios android/src -type f \( -name "*.h" -o -name "*.cpp" -o -name "*.m" -o -name "*.mm" \) -print0 | while read -d $'\0' file; do
5+
clang-format -style=file:./.clang-format -i "$file"
6+
done
7+
else
8+
echo "error: clang-format not installed, install with 'brew install clang-format' (or manually from https://clang.llvm.org/docs/ClangFormat.html)"
9+
exit 1
10+
fi

0 commit comments

Comments
 (0)