diff --git a/src/api/hooks.cc b/src/api/hooks.cc index 037bdda6f41c82..2eb4c146a7d723 100644 --- a/src/api/hooks.cc +++ b/src/api/hooks.cc @@ -10,10 +10,10 @@ using v8::HandleScope; using v8::Integer; using v8::Isolate; using v8::Local; +using v8::NewStringType; using v8::Object; using v8::String; using v8::Value; -using v8::NewStringType; void RunAtExit(Environment* env) { env->RunAtExitCallbacks(); diff --git a/src/inspector/main_thread_interface.cc b/src/inspector/main_thread_interface.cc index a15cd52d239e40..0cf75a37146729 100644 --- a/src/inspector/main_thread_interface.cc +++ b/src/inspector/main_thread_interface.cc @@ -14,8 +14,8 @@ namespace node { namespace inspector { namespace { -using v8_inspector::StringView; using v8_inspector::StringBuffer; +using v8_inspector::StringView; template class DeletableWrapper : public Deletable { diff --git a/src/node_report.cc b/src/node_report.cc index c93e03afe63918..e7bfe7fef09d14 100644 --- a/src/node_report.cc +++ b/src/node_report.cc @@ -43,13 +43,11 @@ using v8::HeapSpaceStatistics; using v8::HeapStatistics; using v8::Isolate; using v8::Local; -using v8::Number; using v8::Object; -using v8::StackTrace; using v8::String; using v8::TryCatch; -using v8::Value; using v8::V8; +using v8::Value; namespace per_process = node::per_process; diff --git a/src/quic/node_quic_session.cc b/src/quic/node_quic_session.cc index 041c601a3c3268..8857a56a60d219 100644 --- a/src/quic/node_quic_session.cc +++ b/src/quic/node_quic_session.cc @@ -43,7 +43,6 @@ using crypto::SecureContext; using v8::Array; using v8::ArrayBufferView; using v8::Context; -using v8::Function; using v8::FunctionCallbackInfo; using v8::FunctionTemplate; using v8::HandleScope; diff --git a/src/quic/node_quic_socket.cc b/src/quic/node_quic_socket.cc index ae0847d8d27bd9..8005b5d8099e5f 100644 --- a/src/quic/node_quic_socket.cc +++ b/src/quic/node_quic_socket.cc @@ -29,7 +29,6 @@ using crypto::EntropySource; using crypto::SecureContext; using v8::ArrayBufferView; -using v8::Boolean; using v8::Context; using v8::FunctionCallbackInfo; using v8::FunctionTemplate; diff --git a/src/quic/node_quic_socket.h b/src/quic/node_quic_socket.h index f108eb47901b81..5b071c41b898df 100644 --- a/src/quic/node_quic_socket.h +++ b/src/quic/node_quic_socket.h @@ -27,10 +27,8 @@ namespace node { using v8::Context; -using v8::FunctionCallbackInfo; using v8::Local; using v8::Object; -using v8::Value; namespace quic { diff --git a/tools/checkimports.py b/tools/checkimports.py index 609a75f542748f..85e247a5bfc777 100755 --- a/tools/checkimports.py +++ b/tools/checkimports.py @@ -5,7 +5,7 @@ import io import re import sys - +import itertools def do_exist(file_name, lines, imported): if not any(not re.match('using \w+::{0};'.format(imported), line) and @@ -16,6 +16,7 @@ def do_exist(file_name, lines, imported): def is_valid(file_name): + print("Processing '{0}'...".format(file_name)) with io.open(file_name, encoding='utf-8') as source_file: lines = [line.strip() for line in source_file] @@ -41,5 +42,11 @@ def is_valid(file_name): return valid if __name__ == '__main__': - files = glob.iglob(sys.argv[1] if len(sys.argv) > 1 else 'src/*.cc') - sys.exit(0 if all(map(is_valid, files)) else 1) + if len(sys.argv) > 1: + files = [] + for pattern in sys.argv[1:]: + files = itertools.chain(files, glob.iglob(pattern)) + print(sys.argv[1:]) + else: + files = glob.iglob('src/*.cc') + sys.exit(0 if all(list(map(is_valid, files))) else 1)