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 770421d cmake: use format for ws checks (#403)
770421d is described below
commit 770421d98506e01bf39789b010c9b674088c49cb
Author: Brian Neradt <[email protected]>
AuthorDate: Tue Nov 25 14:09:38 2025 -0600
cmake: use format for ws checks (#403)
With the following PR, we no longer need to roll our own whitespace
check in ci because the format target itself will cover it as it already
does for cmake, clang, and python formatting.
https://github.com/apache/trafficserver/pull/12696
---
jenkins/github/format.pipeline | 34 ++++++++++++++++++----------------
1 file changed, 18 insertions(+), 16 deletions(-)
diff --git a/jenkins/github/format.pipeline b/jenkins/github/format.pipeline
index 9c46557..858873a 100644
--- a/jenkins/github/format.pipeline
+++ b/jenkins/github/format.pipeline
@@ -58,28 +58,30 @@ pipeline {
echo 'Starting build'
dir('src') {
sh '''#!/bin/bash
- set -x
- git grep -IE ' +$' | fgrep -v 'lib/yamlcpp' |
fgrep -v 'lib/Catch2' | fgrep -v 'lib/systemtap' | fgrep -v '.gold:' | fgrep -v
'.test_input'
- if [ "1" != "$?" ]; then
- echo "Error: Trailing whitespaces are not
allowed!"
- echo "Error: Please run: git grep -IE ' +$'"
- exit 1
- fi
- echo "Success! No trailing whitespace"
- git grep -IE $'\r$' | fgrep -v 'lib/yamlcpp' |
fgrep -v 'lib/Catch2' | fgrep -v 'lib/systemtap' | fgrep -v '.test_input'
- if [ "1" != "$?" ]; then
- echo "Error: Please make sure to run dos2unix
on the above file(s)"
- exit 1
- fi
- echo "Success! No DOS carriage return"
-
- set -x
if [ -d cmake ]
then
cmake -B build
cmake --build build --target format || exit 1
else
+ # The following whitespace checks were added
to the `format` cmake target in 10.2.0, but are not backported to 9.x.
+ set -x
+ git grep -IE ' +$' | fgrep -v 'lib/yamlcpp' |
fgrep -v 'lib/Catch2' | fgrep -v 'lib/systemtap' | fgrep -v '.gold:' | fgrep -v
'.test_input'
+ if [ "1" != "$?" ]; then
+ echo "Error: Trailing whitespaces are not
allowed!"
+ echo "Error: Please run: git grep -IE '
+$'"
+ exit 1
+ fi
+ echo "Success! No trailing whitespace"
+ git grep -IE $'\r$' | fgrep -v 'lib/yamlcpp' |
fgrep -v 'lib/Catch2' | fgrep -v 'lib/systemtap' | fgrep -v '.test_input'
+ if [ "1" != "$?" ]; then
+ echo "Error: Please make sure to run
dos2unix on the above file(s)"
+ exit 1
+ fi
+ echo "Success! No DOS carriage return"
+
+ set -x
+
# Pre 10.x branches only supported autotools.
autoreconf -if && ./configure && make
clang-format || exit 1