Skip to content

Conversation

@addaleax
Copy link
Member

src: fix linter failures

Fix linter failures when running the linter on all source files.

tools: fix C++ import checker argument expansion

Makefile assumes that it can pass a list of files to the import
checker, whereas the import checker expects a single argument
that is interpreted as a blob.

Fix that mismatch by accepting multiple arguments in the import
checker.

Refs: #34565

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

Fix linter failures when running the linter on all source files.
Makefile assumes that it can pass a list of files to the import checker, whereas the import checker expects a single argument that is interpreted as a blob. Fix that mismatch by accepting multiple arguments in the import checker. Refs: nodejs#34565
@addaleaxaddaleax requested a review from a teamJuly 31, 2020 16:04
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-botnodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. labels Jul 31, 2020
@richardlau
Copy link
Member

There's still some sort of weirdness going on. The lint-cpp job from the linter workflow is failing for this PR:

Run make lint-cpp make lint-cpp shell: /bin/bash -e{0} env: PYTHON_VERSION: 3.8 NODE_VERSION: 10.x pythonLocation: /opt/hostedtoolcache/Python/3.8.5/x64 Running C++ linter... using statements aren't sorted in 'test/addons/repl-domain-abort/binding.cc'. Line 28: Actual: v8::Local, Expected: v8::Isolate Line 29: Actual: v8::Isolate, Expected: v8::Local Makefile:1337: recipe for target 'tools/.cpplintstamp' failed make: *** [tools/.cpplintstamp] Error 1 ##[error]Process completed with exit code 2. 

but I'm seeing more failures when I run against a fresh clone locally:

-bash-4.2$ ls -bash-4.2$ git clone https://github.com/addaleax/node -b fix-cpp-import-check-weirdness --depth=1 Cloning into 'node'... remote: Enumerating objects: 32499, done. remote: Counting objects: 100% (32499/32499), done. remote: Compressing objects: 100% (27110/27110), done. remote: Total 32499 (delta 7011), reused 14193 (delta 4235), pack-reused 0 Receiving objects: 100% (32499/32499), 74.99 MiB | 2.49 MiB/s, done. Resolving deltas: 100% (7011/7011), done. Checking out files: 100% (32854/32854), done. -bash-4.2$ cd node/ -bash-4.2$ git rev-parse HEAD 22c467d5ae4c505a2e61b6bcba644a72a8513ecc -bash-4.2$ make lint-cpp Running C++ linter... using statements aren't sorted in 'test/addons/repl-domain-abort/binding.cc'. Line 28: Actual: v8::Local, Expected: v8::Isolate Line 29: Actual: v8::Isolate, Expected: v8::Local File "test/addons/async-hooks-promise/binding.cc" does not use "NewStringType" File "test/addons/dlopen-ping-pong/binding.cc" does not use "NewStringType" using statements aren't sorted in 'test/addons/dlopen-ping-pong/binding.cc'. Line 19: Actual: v8::Object, Expected: v8::NewStringType Line 20: Actual: v8::NewStringType, Expected: v8::Object File "test/addons/non-node-context/binding.cc" does not use "Function" File "test/addons/non-node-context/binding.cc" does not use "FunctionTemplate" File "test/addons/non-node-context/binding.cc" does not use "NewStringType" File "test/addons/uv-handle-leak/binding.cc" does not use "Object" using statements aren't sorted in 'test/cctest/test_util.cc'. Line 61: Actual: node::StringEqualNoCase, Expected: node::Calloc Line 72: Actual: node::StringEqualNoCaseN, Expected: node::Malloc Line 87: Actual: node::ToLower, Expected: node::MaybeStackBuffer Line 101: Actual: node::Malloc, Expected: node::MaybeStackBuffer Line 109: Actual: node::Calloc, Expected: node::SPrintF Line 117: Actual: node::UncheckedMalloc, Expected: node::StringEqualNoCase Line 125: Actual: node::UncheckedCalloc, Expected: node::StringEqualNoCaseN Line 134: Actual: node::MaybeStackBuffer, Expected: node::ToLower Line 214: Actual: node::MaybeStackBuffer, Expected: node::UncheckedCalloc Line 257: Actual: node::SPrintF, Expected: node::UncheckedMalloc using statements aren't sorted in 'test/cctest/test_base64.cc'. Line 8: Actual: node::base64_encode, Expected: node::base64_decode Line 9: Actual: node::base64_decode, Expected: node::base64_encode using statements aren't sorted in 'test/embedding/embedtest.cc'. Line 19: Actual: v8::Value, Expected: v8::V8 Line 20: Actual: v8::V8, Expected: v8::Value make: *** [tools/.cpplintstamp] Error 1 -bash-4.2$ 

@richardlau
Copy link
Member

Unfortunately it looks like Jenkins is currently broken (nodejs/build#2362 (comment) cc @nodejs/build-infra) -- would be interesting to see how the CI linter results tally.

@mmarchinimmarchini added the request-ci Add this label to start a Jenkins CI on a PR. label Aug 1, 2020
@github-actionsgithub-actionsbot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 1, 2020
@nodejs-github-bot
Copy link
Collaborator

@addaleaxaddaleax added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. tools Issues and PRs related to the tools directory. labels Aug 3, 2020
@nodejs-github-bot
Copy link
Collaborator

@addaleaxaddaleax added the request-ci Add this label to start a Jenkins CI on a PR. label Aug 6, 2020
@addaleax
Copy link
MemberAuthor

I can do a manual backport

@nodejs-github-bot
Copy link
Collaborator

@jasnell
Copy link
Member

Landed in 93959b2...318c982

@jasnelljasnell closed this Aug 7, 2020
jasnell pushed a commit that referenced this pull request Aug 7, 2020
Fix linter failures when running the linter on all source files. PR-URL: #34582 Refs: #34565 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: David Carlier <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
jasnell pushed a commit that referenced this pull request Aug 7, 2020
Makefile assumes that it can pass a list of files to the import checker, whereas the import checker expects a single argument that is interpreted as a blob. Fix that mismatch by accepting multiple arguments in the import checker. Refs: #34565 PR-URL: #34582 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: David Carlier <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
addaleax added a commit that referenced this pull request Aug 8, 2020
Fix linter failures when running the linter on all source files. PR-URL: #34582 Refs: #34565 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: David Carlier <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
addaleax added a commit that referenced this pull request Aug 8, 2020
Makefile assumes that it can pass a list of files to the import checker, whereas the import checker expects a single argument that is interpreted as a blob. Fix that mismatch by accepting multiple arguments in the import checker. Refs: #34565 PR-URL: #34582 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: David Carlier <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
@codebyterecodebytere mentioned this pull request Aug 10, 2020
codebytere pushed a commit that referenced this pull request Aug 11, 2020
Fix linter failures when running the linter on all source files. PR-URL: #34582 Refs: #34565 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: David Carlier <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
codebytere pushed a commit that referenced this pull request Aug 11, 2020
Makefile assumes that it can pass a list of files to the import checker, whereas the import checker expects a single argument that is interpreted as a blob. Fix that mismatch by accepting multiple arguments in the import checker. Refs: #34565 PR-URL: #34582 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: David Carlier <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.c++Issues and PRs that require attention from people who are familiar with C++.lib / srcIssues and PRs related to general changes in the lib or src directory.toolsIssues and PRs related to the tools directory.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@addaleax@nodejs-github-bot@richardlau@jasnell@lpinca@devnexen@mmarchini