Skip to content
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

tools: fix check-imports.py to match on word boundaries #33268

Merged
merged 2 commits into from
May 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1328,13 +1328,13 @@ else
CPPLINT_QUIET = --quiet
endif
.PHONY: lint-cpp
# Lints the C++ code with cpplint.py and check-imports.py.
# Lints the C++ code with cpplint.py and checkimports.py.
lint-cpp: tools/.cpplintstamp

tools/.cpplintstamp: $(LINT_CPP_FILES)
@echo "Running C++ linter..."
@$(PYTHON) tools/cpplint.py $(CPPLINT_QUIET) $?
@$(PYTHON) tools/check-imports.py
@$(PYTHON) tools/checkimports.py
@touch $@

.PHONY: lint-addon-docs
Expand Down
1 change: 0 additions & 1 deletion src/async_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ using v8::HandleScope;
using v8::Integer;
using v8::Isolate;
using v8::Local;
using v8::Maybe;
using v8::MaybeLocal;
using v8::Name;
using v8::Number;
Expand Down
1 change: 0 additions & 1 deletion src/heap_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ using v8::Global;
using v8::HandleScope;
using v8::HeapSnapshot;
using v8::Isolate;
using v8::JSON;
using v8::Local;
using v8::MaybeLocal;
using v8::Number;
Expand Down
2 changes: 0 additions & 2 deletions src/inspector_agent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ using v8::Isolate;
using v8::Local;
using v8::Message;
using v8::Object;
using v8::String;
using v8::Task;
using v8::Value;

using v8_inspector::StringBuffer;
Expand Down
1 change: 0 additions & 1 deletion src/inspector_js_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ namespace node {
namespace inspector {
namespace {

using v8::Boolean;
using v8::Context;
using v8::Function;
using v8::FunctionCallbackInfo;
Expand Down
2 changes: 0 additions & 2 deletions src/module_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ using v8::HandleScope;
using v8::Integer;
using v8::IntegrityLevel;
using v8::Isolate;
using v8::Just;
using v8::Local;
using v8::Maybe;
using v8::MaybeLocal;
using v8::Module;
using v8::Number;
Expand Down
1 change: 0 additions & 1 deletion src/node_contextify.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ namespace contextify {
using errors::TryCatchScope;

using v8::Array;
using v8::ArrayBuffer;
using v8::ArrayBufferView;
using v8::Boolean;
using v8::Context;
Expand Down
1 change: 0 additions & 1 deletion src/node_credentials.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ namespace node {

using v8::Array;
using v8::Context;
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::HandleScope;
using v8::Isolate;
Expand Down
1 change: 0 additions & 1 deletion src/node_dir.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ using fs::GetReqWrap;

using v8::Array;
using v8::Context;
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
using v8::HandleScope;
Expand Down
1 change: 0 additions & 1 deletion src/node_dtrace.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ using v8::HandleScope;
using v8::Isolate;
using v8::Local;
using v8::Object;
using v8::String;
using v8::Value;

#define SLURP_STRING(obj, member, valp) \
Expand Down
1 change: 0 additions & 1 deletion src/node_errors.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ using v8::Local;
using v8::Maybe;
using v8::MaybeLocal;
using v8::Message;
using v8::Number;
using v8::Object;
using v8::ScriptOrigin;
using v8::StackFrame;
Expand Down
3 changes: 0 additions & 3 deletions src/node_http2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ using v8::ArrayBufferView;
using v8::Boolean;
using v8::Context;
using v8::EscapableHandleScope;
using v8::Float64Array;
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
Expand All @@ -35,8 +34,6 @@ using v8::Number;
using v8::Object;
using v8::ObjectTemplate;
using v8::String;
using v8::Uint32;
using v8::Uint32Array;
using v8::Uint8Array;
using v8::Undefined;
using v8::Value;
Expand Down
1 change: 0 additions & 1 deletion src/node_main_instance.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ using v8::HandleScope;
using v8::Isolate;
using v8::Local;
using v8::Locker;
using v8::Object;
using v8::SealHandleScope;

NodeMainInstance::NodeMainInstance(Isolate* isolate,
Expand Down
1 change: 0 additions & 1 deletion src/node_messaging.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ using v8::BackingStore;
using v8::CompiledWasmModule;
using v8::Context;
using v8::EscapableHandleScope;
using v8::Exception;
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
Expand Down
3 changes: 0 additions & 3 deletions src/node_native_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@ namespace native_module {
using v8::Context;
using v8::EscapableHandleScope;
using v8::Function;
using v8::HandleScope;
using v8::Integer;
using v8::Isolate;
using v8::Local;
using v8::Maybe;
using v8::MaybeLocal;
using v8::Object;
using v8::Script;
using v8::ScriptCompiler;
using v8::ScriptOrigin;
using v8::String;
Expand Down
1 change: 0 additions & 1 deletion src/node_native_module_env.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ using v8::FunctionCallbackInfo;
using v8::IntegrityLevel;
using v8::Isolate;
using v8::Local;
using v8::Maybe;
using v8::MaybeLocal;
using v8::Name;
using v8::None;
Expand Down
1 change: 0 additions & 1 deletion src/node_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ using v8::Local;
using v8::Map;
using v8::Number;
using v8::Object;
using v8::String;
using v8::Undefined;
using v8::Value;

Expand Down
3 changes: 0 additions & 3 deletions src/node_perf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
namespace node {
namespace performance {

using v8::Array;
using v8::Context;
using v8::DontDelete;
using v8::Function;
Expand All @@ -25,14 +24,12 @@ using v8::Isolate;
using v8::Local;
using v8::Map;
using v8::MaybeLocal;
using v8::Name;
using v8::NewStringType;
using v8::Number;
using v8::Object;
using v8::PropertyAttribute;
using v8::ReadOnly;
using v8::String;
using v8::Uint32Array;
using v8::Value;

// Microseconds in a millisecond, as a float.
Expand Down
2 changes: 0 additions & 2 deletions src/node_process_methods.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,11 @@ using v8::ArrayBuffer;
using v8::BigUint64Array;
using v8::Context;
using v8::Float64Array;
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::HeapStatistics;
using v8::Integer;
using v8::Isolate;
using v8::Local;
using v8::Name;
using v8::NewStringType;
using v8::Number;
using v8::Object;
Expand Down
2 changes: 0 additions & 2 deletions src/node_process_object.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ using v8::EscapableHandleScope;
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
using v8::HandleScope;
using v8::Integer;
using v8::Isolate;
using v8::Just;
using v8::Local;
using v8::MaybeLocal;
using v8::Name;
Expand Down
3 changes: 0 additions & 3 deletions src/node_report.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,8 @@ using v8::HeapSpaceStatistics;
using v8::HeapStatistics;
using v8::Isolate;
using v8::Local;
using v8::Number;
using v8::StackTrace;
using v8::String;
using v8::V8;
using v8::Value;

namespace per_process = node::per_process;

Expand Down
2 changes: 0 additions & 2 deletions src/node_report_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ namespace report {
using node::Environment;
using node::Mutex;
using node::Utf8Value;
using v8::Boolean;
using v8::Context;
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::HandleScope;
using v8::Isolate;
Expand Down
1 change: 0 additions & 1 deletion src/node_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ using v8::Array;
using v8::ArrayBufferView;
using v8::Boolean;
using v8::Context;
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
using v8::Global;
Expand Down
2 changes: 0 additions & 2 deletions src/node_zlib.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@

namespace node {

using v8::Array;
using v8::ArrayBuffer;
using v8::Context;
using v8::Function;
Expand All @@ -56,7 +55,6 @@ using v8::Integer;
using v8::Local;
using v8::Object;
using v8::String;
using v8::Uint32;
using v8::Uint32Array;
using v8::Value;

Expand Down
1 change: 0 additions & 1 deletion src/pipe_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ using v8::EscapableHandleScope;
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
using v8::HandleScope;
using v8::Int32;
using v8::Isolate;
using v8::Local;
Expand Down
1 change: 0 additions & 1 deletion src/tcp_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ using v8::EscapableHandleScope;
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
using v8::HandleScope;
using v8::Int32;
using v8::Integer;
using v8::Local;
Expand Down
1 change: 0 additions & 1 deletion src/tls_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ using v8::HandleScope;
using v8::Integer;
using v8::Isolate;
using v8::Local;
using v8::Maybe;
using v8::MaybeLocal;
using v8::Object;
using v8::PropertyAttribute;
Expand Down
1 change: 0 additions & 1 deletion src/tty_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ namespace node {

using v8::Array;
using v8::Context;
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
using v8::Integer;
Expand Down
7 changes: 7 additions & 0 deletions test/fixtures/tools/checkimports/invalid.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
using v8::MaybeLocal;
using v8::Array;
using v8::Local;

MaybeLocal<Array> CreateObject() const {
return MaybeLocal<Array>();
}
7 changes: 7 additions & 0 deletions test/fixtures/tools/checkimports/maybe.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
using v8::Array;
using v8::Local;
using v8::MaybeLocal;

MaybeLocal<Array> CreateObject() const {
return MaybeLocal<Array>();
}
6 changes: 6 additions & 0 deletions test/fixtures/tools/checkimports/unsorted.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
using v8::MaybeLocal;
using v8::Array;

MaybeLocal<Array> CreateObject() const {
return MaybeLocal<Array>();
}
5 changes: 5 additions & 0 deletions test/fixtures/tools/checkimports/unused.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
using v8::Context;

static void MyMethod(void) {
return;
}
6 changes: 6 additions & 0 deletions test/fixtures/tools/checkimports/valid.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
using v8::Array;
using v8::MaybeLocal;

MaybeLocal<Array> CreateObject() const {
return MaybeLocal<Array>();
}
Loading