MLIR: Add --fix-error to clang-tidy script

This commit is contained in:
Mehdi Amini 2022-11-16 21:29:28 +00:00
parent 34ab474348
commit 377af86847
1 changed files with 4 additions and 4 deletions

View File

@ -72,8 +72,8 @@ find $SRCS | grep ".cpp$" | sort | while read file ; do
echo "-----------------------------------" echo "-----------------------------------"
echo "-- Apply all checks on file $file" echo "-- Apply all checks on file $file"
echo "$TIMING_TIDY $CLANG_TIDY -p $BUILD_DIR $file -fix" echo "$TIMING_TIDY $CLANG_TIDY -p $BUILD_DIR $file -fix -fix-errors"
$TIMING_TIDY $CLANG_TIDY -p $BUILD_DIR $file -fix \ $TIMING_TIDY $CLANG_TIDY -p $BUILD_DIR $file -fix -fix-errors \
| grep "warning:.*\]$" | sed -r 's#.*\[(.*)]$#\1#' | sort -u > $tmpfile | grep "warning:.*\]$" | sed -r 's#.*\[(.*)]$#\1#' | sort -u > $tmpfile
git clang-format -f git clang-format -f
if [[ $(git diff --stat) == '' ]]; then if [[ $(git diff --stat) == '' ]]; then
@ -89,8 +89,8 @@ find $SRCS | grep ".cpp$" | sort | while read file ; do
echo "-----------------------------------" echo "-----------------------------------"
echo "-- Apply check $check on file $file" echo "-- Apply check $check on file $file"
echo "$TIMING_TIDY $CLANG_TIDY -p $BUILD_DIR $file --checks="-*,$check" -fix" echo "$TIMING_TIDY $CLANG_TIDY -p $BUILD_DIR $file --checks="-*,$check" -fix -fix-errors"
{ $TIMING_TIDY $CLANG_TIDY -p $BUILD_DIR $file --checks="-*,$check" -fix ; } 2>&1 { $TIMING_TIDY $CLANG_TIDY -p $BUILD_DIR $file --checks="-*,$check" -fix -fix-errors ; } 2>&1
git clang-format -f git clang-format -f
if [[ $(git diff --stat) == '' ]]; then if [[ $(git diff --stat) == '' ]]; then
echo 'Nothing was applied, skip' echo 'Nothing was applied, skip'