-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use `clang` compiler instead of `gcc`. Remove ansi color from `run-clang-tidy` result. Signed-off-by: Inho Oh <inho.oh@sk.com>
- Loading branch information
Showing
3 changed files
with
31 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Default | ||
# - Disable all | ||
# Enable | ||
# - clang* | ||
# - perf* | ||
# - cert* | ||
# Exclude | ||
# - performance-no-int-to-ptr | ||
# - cert-dcl37-c | ||
# - cert-dcl51-cpp | ||
Checks: '-*, | ||
clang*, | ||
perf*, | ||
cert*, | ||
-performance-no-int-to-ptr, | ||
-cert-dcl37-c, | ||
-cert-dcl51-cpp' | ||
CheckOptions: | ||
InheritParentConfig: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,18 @@ | ||
#!/bin/sh | ||
|
||
mkdir -p temp_build | ||
cd temp_build | ||
#!/bin/bash | ||
|
||
CLANG_RESULT_FILE="result.log" | ||
CHECKER_REPORT_FILE="report.json" | ||
|
||
echo "step-1. generate compile_commands.json" | ||
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ../ > /dev/null | ||
cmake -S . -B temp_build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ > /dev/null | ||
cp temp_build/compile_commands.json . | ||
|
||
echo "step-2. run clang-tidy tools" | ||
run-clang-tidy -checks='-*,clang*,perf*,cert*' > $CLANG_RESULT_FILE | ||
run-clang-tidy | tee >(ansi2txt > $CLANG_RESULT_FILE) | ||
|
||
echo "step-3. run code checker" | ||
echo "step-3. run code checker and generate $CHECKER_REPORT_FILE" | ||
set -e | ||
run_codechecker $CLANG_RESULT_FILE $@ | ||
|
||
echo "step-4. codechecker report generate to $CHECKER_REPORT_FILE" | ||
mv $CHECKER_REPORT_FILE .. | ||
|
||
cd .. | ||
echo "step-4. remove temp build directory" | ||
rm -rf temp_build |