Skip to content

Commit 09c4f6f

Browse files
targosnodejs-github-bot
authored andcommitted
deps,src: prepare for cpplint update
Disable linting where there are false positives or clashes whith the C++ formatter. PR-URL: #60901 Fixes: #60771 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com>
1 parent 85852a3 commit 09c4f6f

File tree

6 files changed

+16
-3
lines changed

6 files changed

+16
-3
lines changed

deps/ncrypto/ncrypto.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ namespace ncrypto {
6666
#define NCRYPTO_STR(x) #x
6767
#define NCRYPTO_REQUIRE(EXPR) \
6868
{ \
69-
if (!(EXPR) { abort(); }) }
69+
if (!(EXPR)) { \
70+
abort(); \
71+
} \
72+
}
7073

7174
#define NCRYPTO_FAIL(MESSAGE) \
7275
do { \

src/crypto/crypto_util.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,9 @@ Maybe<void> Decorate(Environment* env,
556556
#define V(name) case ERR_LIB_##name: lib = #name "_"; break;
557557
const char* lib = "";
558558
const char* prefix = "OSSL_";
559-
switch (ERR_GET_LIB(err)) { OSSL_ERROR_CODES_MAP(V) }
559+
switch (ERR_GET_LIB(err)) { /* NOLINT(whitespace/newline) */
560+
OSSL_ERROR_CODES_MAP(V)
561+
}
560562
#undef V
561563
#undef OSSL_ERROR_CODES_MAP
562564
// Don't generate codes like "ERR_OSSL_SSL_".

src/env.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ void AsyncHooks::push_async_context(
150150

151151
// When this call comes from JS (as a way of increasing the stack size),
152152
// `resource` will be empty, because JS caches these values anyway.
153+
// False positive: https://github.com/cpplint/cpplint/issues/410
154+
// NOLINTNEXTLINE(whitespace/newline)
153155
if (std::visit([](auto* ptr) { return ptr != nullptr; }, resource)) {
154156
native_execution_async_resources_.resize(offset + 1);
155157
// Caveat: This is a v8::Local<>* assignment, we do not keep a v8::Global<>!

src/inspector_socket.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,8 @@ static bool IsIPAddress(const std::string& host) {
206206
// (other than ::/128) that represent non-routable IPv4 addresses. However,
207207
// this translation assumes that the host is interpreted as an IPv6 address
208208
// in the first place, at which point DNS rebinding should not be an issue.
209+
// False positive: https://github.com/cpplint/cpplint/issues/410
210+
// NOLINTNEXTLINE(whitespace/newline)
209211
if (std::ranges::all_of(ipv6, [](auto b) { return b == 0; })) {
210212
return false;
211213
}

src/node_api_types.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
typedef napi_value(NAPI_CDECL* napi_addon_register_func)(napi_env env,
77
napi_value exports);
8+
// False positive: https://github.com/cpplint/cpplint/issues/409
9+
// NOLINTNEXTLINE (readability/casting)
810
typedef int32_t(NAPI_CDECL* node_api_addon_get_api_version_func)(void);
911

1012
typedef struct napi_callback_scope__* napi_callback_scope;

src/quic/session.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,9 @@ constexpr std::string to_string(ngtcp2_cc_algo cc_algorithm) {
161161
#define V(name, label) \
162162
case NGTCP2_CC_ALGO_##name: \
163163
return #label;
164-
switch (cc_algorithm) { CC_ALGOS(V) }
164+
switch (cc_algorithm) { /* NOLINT(whitespace/newline) */
165+
CC_ALGOS(V)
166+
}
165167
return "<unknown>";
166168
#undef V
167169
}

0 commit comments

Comments
 (0)