Clang-Tidy adaptations (#3379)

* gfx: CommandBuffer.draw accept DrawInfo

* clang-tidy config

* tidy adapt

* enable function name check

* better workflow
This commit is contained in:
Yun Hsiao Wu
2021-04-12 09:41:28 +08:00
committed by GitHub
parent 919b10ec72
commit e1c240f2d0
138 changed files with 3866 additions and 3836 deletions
+2 -4
View File
@@ -46,9 +46,7 @@ jobs:
EXT_VERSION=`grep version external/config.json |awk -F'"' '{print $4}'`
rm external/config.json
git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos-creator/engine-native-external external
echo -e "cmake_minimum_required(VERSION 3.8)\nproject(engine_native CXX)\nenable_language(C ASM)" | cat - CMakeLists.txt > tmp.txt
mv tmp.txt CMakeLists.txt
cmake -Bbuild -DCC_USE_GLES2=ON -DCC_USE_VULKAN=ON -DCC_USE_GLES3=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_TOOLCHAIN_FILE="$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake" -DANDROID_PLATFORM=android-21 -G"Unix Makefiles"
utils/generate_compile_commands_android.sh
- name: Generate clang-fix.yaml
shell: bash
@@ -59,7 +57,7 @@ jobs:
if [[ "$FILTERED-xxx" == "-xxx" ]]; then
echo "no source files match"
else
clang-tidy-11 --format-style=file -p ./build --export-fixes=clang-fixes.yaml $FILTERED
clang-tidy-11 --format-style=file --export-fixes=clang-fixes.yaml $FILTERED
fi
- name: clang-tidy-action
uses: PatriceJiang/clang-tidy-action@master
+6 -7
View File
@@ -11,13 +11,12 @@ const cdbFile = path.join(__dirname, '../../build/compile_commands.json');
if (fs.existsSync(cdbFile)) {
const db = JSON.parse(fs.readFileSync(cdbFile, { encoding: 'utf8' }));
for (let f of ARGS) {
for (let t of db) {
if (t.file.endsWith(f)) {
result.push(f);
}
const name = f.endsWith('.h') ? f.slice(0, -2) : f; // ignore .h extension name
if (db.some((info) => info.file.includes(name))) {
result.push(f);
}
}
console.log(result.join(" "));
console.log(result.join(' '));
} else {
console.log(ARGS.join(" "));
}
console.log(ARGS.join(' '));
}