From d0eab6856780bd55e980914856ad9a66c195b38b Mon Sep 17 00:00:00 2001 From: Darshan Sen Date: Wed, 20 Apr 2022 20:30:22 +0530 Subject: [PATCH] build: fix format-cpp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 PR-URL: https://github.com/nodejs/node/pull/42764 Reviewed-By: Tobias Nießen Reviewed-By: Mestery Reviewed-By: Mohammed Keyvanzadeh Reviewed-By: Luigi Pinca --- .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 fa761f4f9de044..7373aabaca0456 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