mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
tools: add clang-tidy rule in src
PR-URL: https://github.com/nodejs/node/pull/26840 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
1 parent
f910f645b9
commit
6f71efa0ed
6 files changed
+43
-12
No files matched your search
@@ -0,0 +1,27 @@
|
||||
---
|
||||
Checks: '-*,
|
||||
# modernize-use-auto,
|
||||
# modernize-use-equals-delete,
|
||||
modernize-deprecated-headers,
|
||||
modernize-make-unique,
|
||||
modernize-make-shared,
|
||||
modernize-redundant-void-arg,
|
||||
modernize-replace-random-shuffle,
|
||||
modernize-shrink-to-fit,
|
||||
modernize-use-bool-literals,
|
||||
modernize-use-emplace,
|
||||
modernize-use-equals-default,
|
||||
modernize-use-nullptr,
|
||||
modernize-use-override,
|
||||
performance-faster-string-find,
|
||||
# performance-unnecessary-value-param, see https://github.com/nodejs/node/pull/26042
|
||||
readability-delete-null-pointer, '
|
||||
WarningsAsErrors: ''
|
||||
HeaderFilterRegex: ''
|
||||
AnalyzeTemporaryDtors: false
|
||||
FormatStyle: none
|
||||
User: nodejs/cpp
|
||||
CheckOptions:
|
||||
- key: google-readability-braces-around-statements.ShortStatementLines
|
||||
value: 1
|
||||
...
|
||||
@@ -591,7 +591,7 @@ struct AllocatedBuffer {
|
||||
class AsyncRequest : public MemoryRetainer {
|
||||
public:
|
||||
AsyncRequest() = default;
|
||||
~AsyncRequest();
|
||||
~AsyncRequest() override;
|
||||
|
||||
AsyncRequest(const AsyncRequest&) = delete;
|
||||
AsyncRequest& operator=(const AsyncRequest&) = delete;
|
||||
@@ -909,7 +909,7 @@ class Environment : public MemoryRetainer {
|
||||
const std::vector<std::string>& exec_args,
|
||||
Flags flags = Flags(),
|
||||
uint64_t thread_id = kNoThreadId);
|
||||
~Environment();
|
||||
~Environment() override;
|
||||
|
||||
void InitializeLibuv(bool start_profiler_idle_notifier);
|
||||
inline const std::vector<std::string>& exec_argv();
|
||||
@@ -1382,7 +1382,8 @@ class Environment : public MemoryRetainer {
|
||||
bool http_parser_buffer_in_use_ = false;
|
||||
std::unique_ptr<http2::Http2State> http2_state_;
|
||||
|
||||
bool debug_enabled_[static_cast<int>(DebugCategory::CATEGORY_COUNT)] = {0};
|
||||
bool debug_enabled_[static_cast<int>(DebugCategory::CATEGORY_COUNT)] = {
|
||||
false};
|
||||
|
||||
AliasedFloat64Array fs_stats_field_array_;
|
||||
AliasedBigUint64Array fs_stats_field_bigint_array_;
|
||||
|
||||
@@ -64,7 +64,7 @@ class FSEventWrap: public HandleWrap {
|
||||
static const encoding kDefaultEncoding = UTF8;
|
||||
|
||||
FSEventWrap(Environment* env, Local<Object> object);
|
||||
~FSEventWrap() = default;
|
||||
~FSEventWrap() override = default;
|
||||
|
||||
static void OnEvent(uv_fs_event_t* handle, const char* filename, int events,
|
||||
int status);
|
||||
|
||||
+1
-1
@@ -829,7 +829,7 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
|
||||
}
|
||||
|
||||
if (will_start_new_arg) {
|
||||
env_argv.push_back(std::string(1, c));
|
||||
env_argv.emplace_back(std::string(1, c));
|
||||
will_start_new_arg = false;
|
||||
} else {
|
||||
env_argv.back() += c;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#include <memory>
|
||||
|
||||
#include "node_main_instance.h"
|
||||
#include "node_internals.h"
|
||||
#include "node_options-inl.h"
|
||||
@@ -34,7 +36,8 @@ NodeMainInstance::NodeMainInstance(Isolate* isolate,
|
||||
isolate_data_(nullptr),
|
||||
owns_isolate_(false),
|
||||
deserialize_mode_(false) {
|
||||
isolate_data_.reset(new IsolateData(isolate_, event_loop, platform, nullptr));
|
||||
isolate_data_ =
|
||||
std::make_unique<IsolateData>(isolate_, event_loop, platform, nullptr);
|
||||
|
||||
IsolateSettings misc;
|
||||
SetIsolateMiscHandlers(isolate_, misc);
|
||||
@@ -76,11 +79,11 @@ NodeMainInstance::NodeMainInstance(
|
||||
deserialize_mode_ = per_isolate_data_indexes != nullptr;
|
||||
// If the indexes are not nullptr, we are not deserializing
|
||||
CHECK_IMPLIES(deserialize_mode_, params->external_references != nullptr);
|
||||
isolate_data_.reset(new IsolateData(isolate_,
|
||||
event_loop,
|
||||
platform,
|
||||
array_buffer_allocator_.get(),
|
||||
per_isolate_data_indexes));
|
||||
isolate_data_ = std::make_unique<IsolateData>(isolate_,
|
||||
event_loop,
|
||||
platform,
|
||||
array_buffer_allocator_.get(),
|
||||
per_isolate_data_indexes);
|
||||
IsolateSettings s;
|
||||
SetIsolateMiscHandlers(isolate_, s);
|
||||
if (!deserialize_mode_) {
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace tracing {
|
||||
|
||||
class TracedValue : public v8::ConvertableToTraceFormat {
|
||||
public:
|
||||
~TracedValue() = default;
|
||||
~TracedValue() override = default;
|
||||
|
||||
static std::unique_ptr<TracedValue> Create();
|
||||
static std::unique_ptr<TracedValue> CreateArray();
|
||||
|
||||
Reference in new issue
Block a user