You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bn...@apache.org on 2026/08/28 17:15:11 UTC

(trafficserver-ci) branch main updated: Add Clang-Tidy CI checks (#459)

This is an automated email from the ASF dual-hosted git repository.

bneradt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/trafficserver-ci.git


The following commit(s) were added to refs/heads/main by this push:
     new e1fc380  Add Clang-Tidy CI checks (#459)
e1fc380 is described below

commit e1fc380c5d135021b94554816578ed8bf8e2adb2
Author: Brian Neradt <br...@gmail.com>
AuthorDate: Fri Aug 28 12:15:05 2026 -0500

    Add Clang-Tidy CI checks (#459)
    
    The Clang analyzer job currently misses several focused correctness
    and lifetime diagnostics available through Clang-Tidy.
    
    This patch adds a separate Clang-Tidy stage that consumes ATS's
    explicit CI configuration, treats findings as errors, and skips branches
    without the configuration.
---
 jenkins/github/clang-analyzer.pipeline | 34 ++++++++++++++++++++++++++++++++--
 1 file changed, 32 insertions(+), 2 deletions(-)

diff --git a/jenkins/github/clang-analyzer.pipeline b/jenkins/github/clang-analyzer.pipeline
index f64c64a..20f6ee3 100644
--- a/jenkins/github/clang-analyzer.pipeline
+++ b/jenkins/github/clang-analyzer.pipeline
@@ -98,8 +98,38 @@ pipeline {
                             make -j4
                         fi
 
-                        # The above will have a non-zero exit if it finds problems. Thus,
-                        # because of `set -e`, if we get here the report was clean.
+                    '''
+                }
+            }
+        }
+        stage('Clang-Tidy') {
+            steps {
+                dir('src') {
+                    sh '''#!/bin/bash
+                        set -x
+                        set -e
+
+                        if [ -d cmake ]
+                        then
+                            if [ -f .clang-tidy-ci ]
+                            then
+                                # Jenkins checks out the ATS source tree in ${WORKSPACE}/src.
+                                run-clang-tidy \
+                                    -j4 \
+                                    -quiet \
+                                    -p build \
+                                    -config-file=.clang-tidy-ci \
+                                    -header-filter="^${WORKSPACE}/src/(include|src|plugins)/" \
+                                    "${WORKSPACE}/src/(src|plugins)/.*"
+                            else
+                                echo "Clang-Tidy CI configuration is not available on this branch."
+                            fi
+                        else
+                            echo "Clang-Tidy is not supported for this branch's autotools build."
+                        fi
+
+                        # The analyzer and Clang-Tidy return non-zero when they find problems.
+                        # With `set -e`, reaching this point means that both runs were clean.
                         touch "${WORKSPACE}/output/No Errors Reported"
                     '''
                 }