From 09c31b17f03f03d016c97948e826aee34b789977 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Fri, 8 Dec 2023 11:10:40 -0500 Subject: [PATCH] jjb: babeltrace: run tools/format-cpp.sh to check C++ formatting Change-Id: I87ce874d12792697522c4a5b92dd120e138791b3 Signed-off-by: Simon Marchi --- jobs/babeltrace.yaml | 17 ++++++++++------- scripts/babeltrace/{pylint.sh => lint.sh} | 5 +++++ 2 files changed, 15 insertions(+), 7 deletions(-) rename scripts/babeltrace/{pylint.sh => lint.sh} (91%) diff --git a/jobs/babeltrace.yaml b/jobs/babeltrace.yaml index ffcf5c3..2d5fe2a 100644 --- a/jobs/babeltrace.yaml +++ b/jobs/babeltrace.yaml @@ -345,7 +345,7 @@ <<: *babeltrace_publishers_review - job-template: - name: 'dev_review_babeltrace_{version}_pylint' + name: 'dev_review_babeltrace_{version}_lint' defaults: babeltrace concurrent: true @@ -359,7 +359,7 @@ builders: - shell: - !include-raw-escape: scripts/babeltrace/pylint.sh + !include-raw-escape: scripts/babeltrace/lint.sh properties: - inject: @@ -369,6 +369,9 @@ days-to-keep: 1 publishers: + - archive: + artifacts: 'black.out,flake8.out,isort.out,clang-format.out' + allow-empty: false - workspace-cleanup: *babeltrace_publisher_workspace-cleanup_defaults - job-template: @@ -525,7 +528,7 @@ - ircbot: *babeltrace_publisher_ircbot_defaults - job-template: - name: babeltrace_{version}_pylint + name: babeltrace_{version}_lint defaults: babeltrace node: 'deb12-amd64' @@ -535,12 +538,12 @@ builders: - shell: - !include-raw-escape: scripts/babeltrace/pylint.sh + !include-raw-escape: scripts/babeltrace/lint.sh publishers: - workspace-cleanup: *babeltrace_publisher_workspace-cleanup_defaults - archive: - artifacts: 'black.out,flake8.out,isort.out' + artifacts: 'black.out,flake8.out,isort.out,clang-format.out' allow-empty: false - ircbot: *babeltrace_publisher_ircbot_defaults - email-ext: *babeltrace_publisher_email-ext_defaults @@ -639,7 +642,7 @@ - 'babeltrace_{version}_release': version: v2.0 - 'babeltrace_{version}_scan-build' - - 'babeltrace_{version}_pylint' + - 'babeltrace_{version}_lint' - 'babeltrace_{version}_coverity': version: master - '{job_prefix}babeltrace_{version}_glib-2.28.6': @@ -777,7 +780,7 @@ filter: '' touchstone: '' - 'dev_review_babeltrace_{version}_check-format' - - 'dev_review_babeltrace_{version}_pylint' + - 'dev_review_babeltrace_{version}_lint' - project: diff --git a/scripts/babeltrace/pylint.sh b/scripts/babeltrace/lint.sh similarity index 91% rename from scripts/babeltrace/pylint.sh rename to scripts/babeltrace/lint.sh index 63e02a8..9471f43 100755 --- a/scripts/babeltrace/pylint.sh +++ b/scripts/babeltrace/lint.sh @@ -60,4 +60,9 @@ else echo "isort is not supported on the 'stable-2.0' branch" > ../../isort.out fi +if [[ -f tools/format-cpp.sh ]]; then + FORMATTER="clang-format-15 -i" tools/format-cpp.sh + git diff --exit-code | tee ../../clang-format.out || exit_code=1 +fi + exit $exit_code -- 2.34.1