Skip to content

Commit 359797c

Browse files
targosaduh95
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 9e2c5fd commit 359797c

File tree

6 files changed

+17
-6
lines changed

6 files changed

+17
-6
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/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/node_report_module.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ void WriteReport(const FunctionCallbackInfo<Value>& info) {
3434
Local<Value> error;
3535

3636
CHECK_EQ(info.Length(), 4);
37-
String::Utf8Value message(isolate, info[0].As<String>());
38-
String::Utf8Value trigger(isolate, info[1].As<String>());
37+
Utf8Value message(isolate, info[0].As<String>());
38+
Utf8Value trigger(isolate, info[1].As<String>());
3939

4040
if (info[2]->IsString())
41-
filename = *String::Utf8Value(isolate, info[2]);
41+
filename = *Utf8Value(isolate, info[2]);
4242
if (!info[3].IsEmpty())
4343
error = info[3];
4444
else

src/quic/session.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,9 @@ std::string to_string(ngtcp2_cc_algo cc_algorithm) {
166166
#define V(name, label) \
167167
case NGTCP2_CC_ALGO_##name: \
168168
return #label;
169-
switch (cc_algorithm) { CC_ALGOS(V) }
169+
switch (cc_algorithm) { /* NOLINT(whitespace/newline) */
170+
CC_ALGOS(V)
171+
}
170172
return "<unknown>";
171173
#undef V
172174
}

0 commit comments

Comments
 (0)