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
nodejs#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: nodejs#42681 (comment)
Signed-off-by: Darshan Sen <raisinten@gmail.com>
  • Loading branch information
RaisinTen committed Apr 17, 2022
1 parent 24adba6 commit 83d34b3
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 83d34b3

Please sign in to comment.