Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Commit

Permalink
replace cpplint in ci with clang-tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
airMeng committed Jan 4, 2024
1 parent fe294cb commit 5d73527
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/format_scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
"bandit",
"clangformat",
"cloc",
"cpplint",
"clangtidy",
# "pydocstyle",
#"pyspelling",
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,19 @@

source /neural-speed/.github/workflows/scripts/change_color.sh

pip install cpplint
pip install cmake ninja clang-tidy
REPO_DIR=/neural-speed
log_dir=/neural-speed/.github/workflows/scripts/formatScan
log_path=${log_dir}/cpplint.log
cpplint --extensions cpp,hpp --filter=-build/include_subdir,-build/header_guard --recursive --quiet --linelength=120 ${REPO_DIR}/neural_speed 2>&1 | tee ${log_path}
if [[ ! -f ${log_path} ]] || [[ $(grep -c "Total errors found:" ${log_path}) != 0 ]]; then
log_path=${log_dir}/clangtidy.log

# compile binary
cd ${REPO_DIR}
mkdir build
cd build
cmake .. -G Ninja -DNS_USE_CLANG_TIDY=CHECK
ninja 2>&1 | tee ${log_path}

if [[ ! -f ${log_path} ]] || [[ $(grep -c "warning:" ${log_path}) != 0 ]]; then
exit 1
fi
$BOLD_PURPLE && echo "Congratulations, check passed!" && $LIGHT_PURPLE && echo "You can click on the artifact button to see the log details." && $RESET
Expand Down

0 comments on commit 5d73527

Please sign in to comment.