-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: update lint-cpp on Windows #18012
Conversation
* Added a `lint-cpp` argument * Updated `findstr` calls to output to `nul` * Updated `findstr` calls to only use `/r` when the input is a regex
ping @nodejs/build |
cc/ @nodejs/platform-windows |
if %errorlevel% equ 0 goto exit | ||
|
||
echo %1 | findstr /r /c:"test\\addons\\[0-9].*_.*\.cc" | ||
echo %1 | findstr /r /c:"test\\addons\\[0-9].*_.*\.cc" > nul 2>&1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AIUI if one of these files is found then vcbuild bails out, wouldn't it be helpful to see which one it was?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not the whole vcbuild
, only the add-to-list
subroutine. I don't really have a strong opinion about the redirects here, stdout is already discarded when calling add-to-list
, but it can perhaps help if there's an error in findstr
. @kfarnung the output with echo on
is the same, is this helpful for you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gibfahn This section of code is call
ed elsewhere in the script. Because of this it's treated as though it's a separate batch execution. The early exits here are more akin to early returns in other languages. This merely filters the list of files that are sent into the CPP linter.
@joaocgreis The output is actually to stdout from what I can see. If you test out findstr
manually it outputs all successful matches and outputs nothing when it doesn't match. Since echo
is being used to pipe into findstr
I don't believe that echo on
has any effect here.
The reason for the redirects is that I actually found these counter-intuitive. I always assumed it was listing the files it was scanning, not the ones that it was ignoring. If there's strong opposition it might be worth trying to update the output so that it indicates that these are the files being ignored, not the ones being scanned.
@gibfahn I can land this, any objection? |
Not at all, please do!
A comment that explains what the Separate topic, but is there a reason to prefer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My question was answered. LGTM.
Well |
@gibfahn I added a comment to the subroutine. Let me know if it's not clear enough. |
LGTM |
Running another CI before landing: https://ci.nodejs.org/job/node-test-pull-request/12565/ - PASSED on re-runs except for the Windows failure called out below. |
LinuxOne re-run: https://ci.nodejs.org/job/node-test-commit-linuxone/11913/ - PASSED |
Windows re-run: https://ci.nodejs.org/job/node-test-commit-windows-fanned/14931/ Still seeing a failure, but it looks the same as #18190:
|
Arm re-run: https://ci.nodejs.org/job/node-test-commit-arm/13135/ - PASSED |
Landed in cd60c7d |
* Added a `lint-cpp` argument * Updated `findstr` calls to output to `nul` * Updated `findstr` calls to only use `/r` when the input is a regex PR-URL: #18012 Reviewed-By: João Reis <reis@janeasystems.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
* Added a `lint-cpp` argument * Updated `findstr` calls to output to `nul` * Updated `findstr` calls to only use `/r` when the input is a regex PR-URL: #18012 Reviewed-By: João Reis <reis@janeasystems.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
* Added a `lint-cpp` argument * Updated `findstr` calls to output to `nul` * Updated `findstr` calls to only use `/r` when the input is a regex PR-URL: #18012 Reviewed-By: João Reis <reis@janeasystems.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Should this be backported to |
lint-cpp
argumentfindstr
calls to output tonul
findstr
calls to only use/r
when the input is a regexChecklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes\Affected core subsystem(s)
build