From 83d34b39ccb41c437ba0e5ee9eb9f33dd22a9aa5 Mon Sep 17 00:00:00 2001 From: Darshan Sen Date: Sun, 17 Apr 2022 18:51:08 +0530 Subject: [PATCH] build: fix format-cpp According to the logs in https://github.com/nodejs/node/pull/42681#issuecomment-1100856089, `make format-cpp` exits with an NZEC. This change intentionally ignores the error code because it is irrelevant. We already check if the formatter produced a diff in the next line. Refs: https://github.com/nodejs/node/pull/42681#issuecomment-1100856089 Signed-off-by: Darshan Sen --- .github/workflows/linters.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 312ba0b3c9706a..57e81a2f7ae25a 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -70,8 +70,12 @@ jobs: - name: Format C/C++ files run: | make format-cpp-build + # The `make format-cpp` error code is intentionally ignored here + # because it is irrelevant. We already check if the formatter produced + # a diff in the next line. + # Refs: https://github.com/nodejs/node/pull/42764 CLANG_FORMAT_START="$(git merge-base HEAD refs/remotes/origin/$GITHUB_BASE_REF)" \ - make format-cpp + make format-cpp || true git --no-pager diff --exit-code && EXIT_CODE="$?" || EXIT_CODE="$?" if [ "$EXIT_CODE" != "0" ] then