From 7be3b22e05668f4ca74f2ac975df5b188fd3de02 Mon Sep 17 00:00:00 2001 From: Eduardo Salinas Date: Thu, 25 Aug 2022 11:28:59 -0400 Subject: [PATCH 01/10] ci: clang-tidy only errors --- .scripts/linux/run-clang-tidy.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.scripts/linux/run-clang-tidy.sh b/.scripts/linux/run-clang-tidy.sh index fcc2cee3c6f..6d6335c99ad 100755 --- a/.scripts/linux/run-clang-tidy.sh +++ b/.scripts/linux/run-clang-tidy.sh @@ -8,4 +8,5 @@ cd $REPO_DIR # -DCMAKE_EXPORT_COMPILE_COMMANDS=On is manually set because in CMake 3.16, just setting it in the CMakeLists.txt does not work. cmake -S . -B build -DFMT_SYS_DEP=On -DSPDLOG_SYS_DEP=On -DVW_BOOST_MATH_SYS_DEP=On -DBUILD_TESTING=Off -DVW_BUILD_VW_C_WRAPPER=Off -DCMAKE_EXPORT_COMPILE_COMMANDS=On -run-clang-tidy -p build -header-filter=vw/* +# remove grep to view warnings and not only errors +run-clang-tidy -p build -header-filter=vw/* | grep -A 3 ": error" From a9705a28d8dfc89a7d2965f7b76fd9d02ae3affb Mon Sep 17 00:00:00 2001 From: Eduardo Salinas Date: Thu, 25 Aug 2022 11:53:18 -0400 Subject: [PATCH 02/10] test with quiet --- .scripts/linux/run-clang-tidy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scripts/linux/run-clang-tidy.sh b/.scripts/linux/run-clang-tidy.sh index 6d6335c99ad..18686775dd9 100755 --- a/.scripts/linux/run-clang-tidy.sh +++ b/.scripts/linux/run-clang-tidy.sh @@ -9,4 +9,4 @@ cd $REPO_DIR # -DCMAKE_EXPORT_COMPILE_COMMANDS=On is manually set because in CMake 3.16, just setting it in the CMakeLists.txt does not work. cmake -S . -B build -DFMT_SYS_DEP=On -DSPDLOG_SYS_DEP=On -DVW_BOOST_MATH_SYS_DEP=On -DBUILD_TESTING=Off -DVW_BUILD_VW_C_WRAPPER=Off -DCMAKE_EXPORT_COMPILE_COMMANDS=On # remove grep to view warnings and not only errors -run-clang-tidy -p build -header-filter=vw/* | grep -A 3 ": error" +run-clang-tidy -p build -quiet -header-filter=vw/* | grep -A 3 ": error" From ca2821aa99ce1d7a6e5dbf67ebec8daf9a2e025b Mon Sep 17 00:00:00 2001 From: Eduardo Salinas Date: Thu, 25 Aug 2022 12:20:19 -0400 Subject: [PATCH 03/10] Update run-clang-tidy.sh --- .scripts/linux/run-clang-tidy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scripts/linux/run-clang-tidy.sh b/.scripts/linux/run-clang-tidy.sh index 18686775dd9..9ab253747d6 100755 --- a/.scripts/linux/run-clang-tidy.sh +++ b/.scripts/linux/run-clang-tidy.sh @@ -9,4 +9,4 @@ cd $REPO_DIR # -DCMAKE_EXPORT_COMPILE_COMMANDS=On is manually set because in CMake 3.16, just setting it in the CMakeLists.txt does not work. cmake -S . -B build -DFMT_SYS_DEP=On -DSPDLOG_SYS_DEP=On -DVW_BOOST_MATH_SYS_DEP=On -DBUILD_TESTING=Off -DVW_BUILD_VW_C_WRAPPER=Off -DCMAKE_EXPORT_COMPILE_COMMANDS=On # remove grep to view warnings and not only errors -run-clang-tidy -p build -quiet -header-filter=vw/* | grep -A 3 ": error" +run-clang-tidy -p build -quiet -header-filter=vw/* 2>error.txt | grep -A 3 ": error" From 15c18ed877049ffc0001aa102f3679803f6c1618 Mon Sep 17 00:00:00 2001 From: Eduardo Salinas Date: Thu, 25 Aug 2022 12:40:35 -0400 Subject: [PATCH 04/10] Update run-clang-tidy.sh --- .scripts/linux/run-clang-tidy.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.scripts/linux/run-clang-tidy.sh b/.scripts/linux/run-clang-tidy.sh index 9ab253747d6..9da095729a6 100755 --- a/.scripts/linux/run-clang-tidy.sh +++ b/.scripts/linux/run-clang-tidy.sh @@ -9,4 +9,14 @@ cd $REPO_DIR # -DCMAKE_EXPORT_COMPILE_COMMANDS=On is manually set because in CMake 3.16, just setting it in the CMakeLists.txt does not work. cmake -S . -B build -DFMT_SYS_DEP=On -DSPDLOG_SYS_DEP=On -DVW_BOOST_MATH_SYS_DEP=On -DBUILD_TESTING=Off -DVW_BUILD_VW_C_WRAPPER=Off -DCMAKE_EXPORT_COMPILE_COMMANDS=On # remove grep to view warnings and not only errors -run-clang-tidy -p build -quiet -header-filter=vw/* 2>error.txt | grep -A 3 ": error" +run-clang-tidy -p build -quiet -header-filter=vw/* 1>out.txt 2>error.txt +cat out.txt | grep -A 3 ": error" > onlyerrors.txt + +if [ -s onlyerrors.txt ]; then + # The file is not-empty. + cat onlyerrors.txt + exit 11 +else + # The file is empty. + cat error.txt +fi From 741175572b66ea9f7a9e1c5444701fd6805f4cfa Mon Sep 17 00:00:00 2001 From: Eduardo Salinas Date: Thu, 25 Aug 2022 12:59:03 -0400 Subject: [PATCH 05/10] Update run-clang-tidy.sh --- .scripts/linux/run-clang-tidy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scripts/linux/run-clang-tidy.sh b/.scripts/linux/run-clang-tidy.sh index 9da095729a6..149f783791e 100755 --- a/.scripts/linux/run-clang-tidy.sh +++ b/.scripts/linux/run-clang-tidy.sh @@ -9,7 +9,7 @@ cd $REPO_DIR # -DCMAKE_EXPORT_COMPILE_COMMANDS=On is manually set because in CMake 3.16, just setting it in the CMakeLists.txt does not work. cmake -S . -B build -DFMT_SYS_DEP=On -DSPDLOG_SYS_DEP=On -DVW_BOOST_MATH_SYS_DEP=On -DBUILD_TESTING=Off -DVW_BUILD_VW_C_WRAPPER=Off -DCMAKE_EXPORT_COMPILE_COMMANDS=On # remove grep to view warnings and not only errors -run-clang-tidy -p build -quiet -header-filter=vw/* 1>out.txt 2>error.txt +run-clang-tidy -p build -quiet -header-filter=vw/* 1>out.txt 2>error.txt || true cat out.txt | grep -A 3 ": error" > onlyerrors.txt if [ -s onlyerrors.txt ]; then From 5e725a61554a8d77371e1714b275a43747d99d3b Mon Sep 17 00:00:00 2001 From: Eduardo Salinas Date: Thu, 25 Aug 2022 13:00:49 -0400 Subject: [PATCH 06/10] Update run-clang-tidy.sh --- .scripts/linux/run-clang-tidy.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.scripts/linux/run-clang-tidy.sh b/.scripts/linux/run-clang-tidy.sh index 149f783791e..a2dbad0e9c8 100755 --- a/.scripts/linux/run-clang-tidy.sh +++ b/.scripts/linux/run-clang-tidy.sh @@ -9,14 +9,14 @@ cd $REPO_DIR # -DCMAKE_EXPORT_COMPILE_COMMANDS=On is manually set because in CMake 3.16, just setting it in the CMakeLists.txt does not work. cmake -S . -B build -DFMT_SYS_DEP=On -DSPDLOG_SYS_DEP=On -DVW_BOOST_MATH_SYS_DEP=On -DBUILD_TESTING=Off -DVW_BUILD_VW_C_WRAPPER=Off -DCMAKE_EXPORT_COMPILE_COMMANDS=On # remove grep to view warnings and not only errors -run-clang-tidy -p build -quiet -header-filter=vw/* 1>out.txt 2>error.txt || true -cat out.txt | grep -A 3 ": error" > onlyerrors.txt +run-clang-tidy -p build -quiet -header-filter=vw/* 1>tidy_out.txt 2>tidy_error.txt || true +grep -A 3 ": error" -f tidy_out.txt > tidy_onlyerrors.txt -if [ -s onlyerrors.txt ]; then +if [ -s tidy_onlyerrors.txt ]; then # The file is not-empty. - cat onlyerrors.txt + cat tidy_onlyerrors.txt exit 11 else # The file is empty. - cat error.txt + cat tidy_error.txt fi From 39bbd8cd3007f6c91d542af70d1c193f30e9081a Mon Sep 17 00:00:00 2001 From: Eduardo Salinas Date: Thu, 25 Aug 2022 13:12:13 -0400 Subject: [PATCH 07/10] Update run-clang-tidy.sh --- .scripts/linux/run-clang-tidy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scripts/linux/run-clang-tidy.sh b/.scripts/linux/run-clang-tidy.sh index a2dbad0e9c8..85c8f3adac1 100755 --- a/.scripts/linux/run-clang-tidy.sh +++ b/.scripts/linux/run-clang-tidy.sh @@ -10,7 +10,7 @@ cd $REPO_DIR cmake -S . -B build -DFMT_SYS_DEP=On -DSPDLOG_SYS_DEP=On -DVW_BOOST_MATH_SYS_DEP=On -DBUILD_TESTING=Off -DVW_BUILD_VW_C_WRAPPER=Off -DCMAKE_EXPORT_COMPILE_COMMANDS=On # remove grep to view warnings and not only errors run-clang-tidy -p build -quiet -header-filter=vw/* 1>tidy_out.txt 2>tidy_error.txt || true -grep -A 3 ": error" -f tidy_out.txt > tidy_onlyerrors.txt +grep -A 3 ": error" tidy_out.txt > tidy_onlyerrors.txt if [ -s tidy_onlyerrors.txt ]; then # The file is not-empty. From d8916bf140816d384aa6faff288f11b3632d4006 Mon Sep 17 00:00:00 2001 From: Eduardo Salinas Date: Thu, 25 Aug 2022 13:24:17 -0400 Subject: [PATCH 08/10] Update run-clang-tidy.sh --- .scripts/linux/run-clang-tidy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scripts/linux/run-clang-tidy.sh b/.scripts/linux/run-clang-tidy.sh index 85c8f3adac1..3ffe6f5939a 100755 --- a/.scripts/linux/run-clang-tidy.sh +++ b/.scripts/linux/run-clang-tidy.sh @@ -18,5 +18,5 @@ if [ -s tidy_onlyerrors.txt ]; then exit 11 else # The file is empty. - cat tidy_error.txt + cat tidy_out.txt fi From 42b2317510adfb1f86f68a9cfcb688c9934fc213 Mon Sep 17 00:00:00 2001 From: Eduardo Salinas Date: Thu, 25 Aug 2022 13:25:11 -0400 Subject: [PATCH 09/10] Update run-clang-tidy.sh --- .scripts/linux/run-clang-tidy.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.scripts/linux/run-clang-tidy.sh b/.scripts/linux/run-clang-tidy.sh index 3ffe6f5939a..11cc46918e9 100755 --- a/.scripts/linux/run-clang-tidy.sh +++ b/.scripts/linux/run-clang-tidy.sh @@ -13,10 +13,9 @@ run-clang-tidy -p build -quiet -header-filter=vw/* 1>tidy_out.txt 2>tidy_error.t grep -A 3 ": error" tidy_out.txt > tidy_onlyerrors.txt if [ -s tidy_onlyerrors.txt ]; then - # The file is not-empty. + # file has contents cat tidy_onlyerrors.txt exit 11 else - # The file is empty. cat tidy_out.txt fi From c4f39ba095173bade605b62c1d8d690d8754fea1 Mon Sep 17 00:00:00 2001 From: Eduardo Salinas Date: Thu, 25 Aug 2022 13:25:36 -0400 Subject: [PATCH 10/10] Update run-clang-tidy.sh --- .scripts/linux/run-clang-tidy.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/.scripts/linux/run-clang-tidy.sh b/.scripts/linux/run-clang-tidy.sh index 11cc46918e9..b6017e295fc 100755 --- a/.scripts/linux/run-clang-tidy.sh +++ b/.scripts/linux/run-clang-tidy.sh @@ -8,7 +8,6 @@ cd $REPO_DIR # -DCMAKE_EXPORT_COMPILE_COMMANDS=On is manually set because in CMake 3.16, just setting it in the CMakeLists.txt does not work. cmake -S . -B build -DFMT_SYS_DEP=On -DSPDLOG_SYS_DEP=On -DVW_BOOST_MATH_SYS_DEP=On -DBUILD_TESTING=Off -DVW_BUILD_VW_C_WRAPPER=Off -DCMAKE_EXPORT_COMPILE_COMMANDS=On -# remove grep to view warnings and not only errors run-clang-tidy -p build -quiet -header-filter=vw/* 1>tidy_out.txt 2>tidy_error.txt || true grep -A 3 ": error" tidy_out.txt > tidy_onlyerrors.txt