-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
build: run clang-format on CI #42681
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
build: run clang-format on CI #42681
Conversation
Review requested:
|
We already include the tool inside tools/clang-format, so we should start using it on CI. This attempts to run the linter only on the commits present in an opened PR. Signed-off-by: Darshan Sen <raisinten@gmail.com>
Signed-off-by: Darshan Sen <raisinten@gmail.com>
6c3f55c
to
acfed40
Compare
Signed-off-by: Darshan Sen <raisinten@gmail.com>
Not a blocking comment, but for reviewers who may not be aware:
Refs: #42665 (comment) |
Doesn't it only affect the changed lines? |
Yes, that's the intent. |
I was under the impression that it only affects changed files, but is it actually only the changed lines in those files? If so, I didn't realize it was that granular. That's very helpful in this situation. |
I think the answer is "no" but just to make sure: Will we want to start checking in the |
Yes, that's right. It was one of the key points that made #21997 a better approach than #16122.
Did you get a chance to go through the demo I edited into the PR description?
Running Lines 1443 to 1444 in 0c57a37
|
That works for me. |
Needed another approval because I committed #42681 (comment) after the last review. |
We already include the tool inside tools/clang-format, so we should start using it on CI. This attempts to run the linter only on the commits present in an opened PR. Signed-off-by: Darshan Sen <raisinten@gmail.com> PR-URL: nodejs#42681 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Is the failure in #42701 related to this change? The output is not particularly helpful:
|
@tniessen You mean in #42701? Hmm, the error looks different from what I got in this PR (as you can see in the description, it is supposed to print the diff and also print the command you can run to fix it locally). 👀 |
Oops, yes, that's what I mean :) I did that, seems to pass now. |
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>
Since we run the formatter only on PRs that are targetting the master branch, let's specify that. Refs: nodejs#42681 (comment) Signed-off-by: Darshan Sen <raisinten@gmail.com>
Since we run the formatter only on PRs that are targeting the master branch, let's specify that. Refs: nodejs#42681 (comment) Signed-off-by: Darshan Sen <raisinten@gmail.com>
Since we run the formatter only on PRs that are targeting the master branch, let's specify that. Refs: nodejs#42681 (comment) Signed-off-by: Darshan Sen <raisinten@gmail.com>
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>
We already include the tool inside tools/clang-format, so we should start using it on CI. This attempts to run the linter only on the commits present in an opened PR. Signed-off-by: Darshan Sen <raisinten@gmail.com> PR-URL: nodejs#42681 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
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> PR-URL: nodejs#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>
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>
We already include the tool inside tools/clang-format, so we should start using it on CI. This attempts to run the linter only on the commits present in an opened PR. Signed-off-by: Darshan Sen <raisinten@gmail.com> PR-URL: #42681 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
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>
We already include the tool inside tools/clang-format, so we should start using it on CI. This attempts to run the linter only on the commits present in an opened PR. Signed-off-by: Darshan Sen <raisinten@gmail.com> PR-URL: #42681 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
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>
We already include the tool inside tools/clang-format, so we should start using it on CI. This attempts to run the linter only on the commits present in an opened PR. Signed-off-by: Darshan Sen <raisinten@gmail.com> PR-URL: #42681 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
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>
We already include the tool inside tools/clang-format, so we should start using it on CI. This attempts to run the linter only on the commits present in an opened PR. Signed-off-by: Darshan Sen <raisinten@gmail.com> PR-URL: #42681 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
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>
We already include the tool inside tools/clang-format, so we should start using it on CI. This attempts to run the linter only on the commits present in an opened PR. Signed-off-by: Darshan Sen <raisinten@gmail.com> PR-URL: nodejs/node#42681 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
According to the logs in nodejs/node#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/node#42681 (comment) Signed-off-by: Darshan Sen <raisinten@gmail.com> PR-URL: nodejs/node#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>
We already include the tool inside
tools/clang-format
, so we shouldstart using it on CI. This attempts to run the linter only on the
commits present in an opened PR.
Demo
The diff in acfed40:
triggers the clang-format linter and it fails the CI run with this error: https://github.com/nodejs/node/runs/5960445927?check_suite_focus=true
. Accepting the suggested change in abfa103 produces a green CI - https://github.com/nodejs/node/runs/5960458481?check_suite_focus=true.
Signed-off-by: Darshan Sen raisinten@gmail.com