Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[clang] Improve CI output when trailing whitespace is found #66649

Merged
merged 1 commit into from
Sep 19, 2023

Conversation

ldionne
Copy link
Member

@ldionne ldionne commented Sep 18, 2023

Fixes #66468

@llvmbot llvmbot added the clang Clang issues not falling into any other category label Sep 18, 2023
@ldionne
Copy link
Member Author

ldionne commented Sep 18, 2023

@asl This should make it a bit more explicit. I see this now when running locally:

+ echo '*** Checking for trailing whitespace left in Clang source files ***'
*** Checking for trailing whitespace left in Clang source files ***
+ grep -rnI '[[:blank:]]$' clang/lib clang/include clang/docs
clang/include/clang-c/Index.h:38:
+ echo '*** Trailing whitespace has been found in Clang source files as described above ***'
*** Trailing whitespace has been found in Clang source files as described above ***
+ exit 1

WDYT? It's still a bit cluttered by the fact that we run with set -x but I think it might be good enough.

@llvmbot
Copy link
Member

llvmbot commented Sep 18, 2023

@llvm/pr-subscribers-clang

Changes

Fixes #66468

Full diff: https://github.com/llvm/llvm-project/pull/66649.diff

1 Files Affected:

  • (modified) clang/utils/ci/run-buildbot (+5-1)
diff --git a/clang/utils/ci/run-buildbot b/clang/utils/ci/run-buildbot
index d117fccc7e3fbd8..f47ffb5cbd38dcd 100755
--- a/clang/utils/ci/run-buildbot
+++ b/clang/utils/ci/run-buildbot
@@ -70,7 +70,11 @@ ninja --version
 
 case "${BUILDER}" in
 check-format)
-    ! grep -rnI '[[:blank:]]$' clang/lib clang/include clang/docs
+    echo "*** Checking for trailing whitespace left in Clang source files ***"
+    if grep -rnI '[[:blank:]]$' clang/lib clang/include clang/docs; then
+        echo "*** Trailing whitespace has been found in Clang source files as described above ***"
+        exit 1
+    fi
 ;;
 build-clang)
     mkdir install

@ldionne ldionne merged commit 6af2674 into llvm:main Sep 19, 2023
@ldionne ldionne deleted the review/clang-whitespace-verbose branch September 19, 2023 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

clang-format job on Buildkite is bogus
2 participants