Skip to content

Commit

Permalink
build: fix format-cpp
Browse files Browse the repository at this point in the history
According to the logs in
#42681 (comment),
`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: #42681 (comment)
Signed-off-by: Darshan Sen <raisinten@gmail.com>

PR-URL: #42764
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
RaisinTen authored and juanarbol committed May 31, 2022
1 parent f41ea76 commit 6190552
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6190552

Please sign in to comment.