Skip to content

Commit

Permalink
src: fix linter failures
Browse files Browse the repository at this point in the history
Fix linter failures when running the linter on all source files.

PR-URL: #34582
Refs: #34565
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
addaleax authored and codebytere committed Aug 11, 2020
1 parent a944dab commit e97fe4b
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 29 deletions.
2 changes: 1 addition & 1 deletion src/api/hooks.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/inspector/main_thread_interface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ namespace node {
namespace inspector {
namespace {

using v8_inspector::StringView;
using v8_inspector::StringBuffer;
using v8_inspector::StringView;

template <typename T>
class DeletableWrapper : public Deletable {
Expand Down
4 changes: 1 addition & 3 deletions src/node_report.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
1 change: 0 additions & 1 deletion test/addons/async-hooks-promise/binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ namespace {
using v8::FunctionCallbackInfo;
using v8::Isolate;
using v8::Local;
using v8::NewStringType;
using v8::Object;
using v8::Promise;
using v8::String;
Expand Down
1 change: 0 additions & 1 deletion test/addons/dlopen-ping-pong/binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ using v8::FunctionCallbackInfo;
using v8::Isolate;
using v8::Local;
using v8::Object;
using v8::NewStringType;
using v8::String;
using v8::Value;

Expand Down
3 changes: 0 additions & 3 deletions test/addons/non-node-context/binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,9 @@
namespace {

using v8::Context;
using v8::Function;
using v8::FunctionTemplate;
using v8::Isolate;
using v8::Local;
using v8::MaybeLocal;
using v8::NewStringType;
using v8::Object;
using v8::Script;
using v8::String;
Expand Down
2 changes: 1 addition & 1 deletion test/addons/repl-domain-abort/binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
using v8::Boolean;
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::Local;
using v8::Isolate;
using v8::Local;
using v8::Object;
using v8::Value;

Expand Down
1 change: 0 additions & 1 deletion test/addons/uv-handle-leak/binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ using v8::Context;
using v8::FunctionCallbackInfo;
using v8::Isolate;
using v8::Local;
using v8::Object;
using v8::Value;

// Give these things names in the public namespace so that we can see
Expand Down
2 changes: 0 additions & 2 deletions test/addons/worker-addon/binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
#include <uv.h>

using v8::Context;
using v8::HandleScope;
using v8::Isolate;
using v8::Local;
using v8::Object;
using v8::Value;
Expand Down
2 changes: 1 addition & 1 deletion test/cctest/test_base64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

#include "gtest/gtest.h"

using node::base64_encode;
using node::base64_decode;
using node::base64_encode;

TEST(Base64Test, Encode) {
auto test = [](const char* string, const char* base64_string) {
Expand Down
23 changes: 10 additions & 13 deletions test/cctest/test_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
#include "env-inl.h"
#include "gtest/gtest.h"

using node::Calloc;
using node::Malloc;
using node::MaybeStackBuffer;
using node::SPrintF;
using node::StringEqualNoCase;
using node::StringEqualNoCaseN;
using node::ToLower;
using node::UncheckedCalloc;
using node::UncheckedMalloc;

TEST(UtilTest, ListHead) {
struct Item { node::ListNode<Item> node_; };
typedef node::ListHead<Item, &Item::node_> List;
Expand Down Expand Up @@ -58,7 +68,6 @@ TEST(UtilTest, ListHead) {
}

TEST(UtilTest, StringEqualNoCase) {
using node::StringEqualNoCase;
EXPECT_FALSE(StringEqualNoCase("a", "b"));
EXPECT_TRUE(StringEqualNoCase("", ""));
EXPECT_TRUE(StringEqualNoCase("equal", "equal"));
Expand All @@ -69,7 +78,6 @@ TEST(UtilTest, StringEqualNoCase) {
}

TEST(UtilTest, StringEqualNoCaseN) {
using node::StringEqualNoCaseN;
EXPECT_FALSE(StringEqualNoCaseN("a", "b", strlen("a")));
EXPECT_TRUE(StringEqualNoCaseN("", "", strlen("")));
EXPECT_TRUE(StringEqualNoCaseN("equal", "equal", strlen("equal")));
Expand All @@ -84,7 +92,6 @@ TEST(UtilTest, StringEqualNoCaseN) {
}

TEST(UtilTest, ToLower) {
using node::ToLower;
EXPECT_EQ('0', ToLower('0'));
EXPECT_EQ('a', ToLower('a'));
EXPECT_EQ('a', ToLower('A'));
Expand All @@ -98,31 +105,27 @@ TEST(UtilTest, ToLower) {
} while (0)

TEST(UtilTest, Malloc) {
using node::Malloc;
TEST_AND_FREE(Malloc<char>(0));
TEST_AND_FREE(Malloc<char>(1));
TEST_AND_FREE(Malloc(0));
TEST_AND_FREE(Malloc(1));
}

TEST(UtilTest, Calloc) {
using node::Calloc;
TEST_AND_FREE(Calloc<char>(0));
TEST_AND_FREE(Calloc<char>(1));
TEST_AND_FREE(Calloc(0));
TEST_AND_FREE(Calloc(1));
}

TEST(UtilTest, UncheckedMalloc) {
using node::UncheckedMalloc;
TEST_AND_FREE(UncheckedMalloc<char>(0));
TEST_AND_FREE(UncheckedMalloc<char>(1));
TEST_AND_FREE(UncheckedMalloc(0));
TEST_AND_FREE(UncheckedMalloc(1));
}

TEST(UtilTest, UncheckedCalloc) {
using node::UncheckedCalloc;
TEST_AND_FREE(UncheckedCalloc<char>(0));
TEST_AND_FREE(UncheckedCalloc<char>(1));
TEST_AND_FREE(UncheckedCalloc(0));
Expand All @@ -131,8 +134,6 @@ TEST(UtilTest, UncheckedCalloc) {

template <typename T>
static void MaybeStackBufferBasic() {
using node::MaybeStackBuffer;

MaybeStackBuffer<T> buf;
size_t old_length;
size_t old_capacity;
Expand Down Expand Up @@ -211,8 +212,6 @@ static void MaybeStackBufferBasic() {
}

TEST(UtilTest, MaybeStackBuffer) {
using node::MaybeStackBuffer;

MaybeStackBufferBasic<uint8_t>();
MaybeStackBufferBasic<uint16_t>();

Expand Down Expand Up @@ -254,8 +253,6 @@ TEST(UtilTest, MaybeStackBuffer) {
}

TEST(UtilTest, SPrintF) {
using node::SPrintF;

// %d, %u and %s all do the same thing. The actual C++ type is used to infer
// the right representation.
EXPECT_EQ(SPrintF("%s", false), "false");
Expand Down
2 changes: 1 addition & 1 deletion test/embedding/embedtest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ using v8::Local;
using v8::Locker;
using v8::MaybeLocal;
using v8::SealHandleScope;
using v8::Value;
using v8::V8;
using v8::Value;

static int RunNodeInstance(MultiIsolatePlatform* platform,
const std::vector<std::string>& args,
Expand Down

0 comments on commit e97fe4b

Please sign in to comment.