-
Notifications
You must be signed in to change notification settings - Fork 30.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding CPPLinting paths src/tracing/ also to make file #14497
Conversation
Makefile
Outdated
@@ -896,6 +896,9 @@ CPPLINT_FILES = $(filter-out $(CPPLINT_EXCLUDE), $(wildcard \ | |||
src/*.c \ | |||
src/*.cc \ | |||
src/*.h \ | |||
src/tracing/.c \ | |||
src/tracing/.cc \ | |||
src/tracing/.h \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are missing the wildcard character before the file extension (*.c
).
Also, use src/*/*.c
instead of src/tracing/*.c
so that this is future-proof.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok , sure I thought I want to keep now as a folder specific.
I will do the changes
Have you ever done CPPLint locally and passed after you modifying the configuration? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM if CPPLint passed locally and CI is green.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@XadillaX src/tracing/* files don't pass cpplint last time I checked.
I will check one more time @TimothyGu update : My- bad I did made the make test before saving the file, now liniting issues fixed, please do review |
4211973
to
29638c6
Compare
src/tracing/node_trace_buffer.cc
Outdated
uv_close(reinterpret_cast<uv_handle_t*>(&buffer->exit_signal_), | ||
[](uv_handle_t* signal) { | ||
NodeTraceBuffer* buffer = | ||
reinterpret_cast<NodeTraceBuffer*>(signal->data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Four-space indentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
src/tracing/node_trace_buffer.h
Outdated
@@ -75,7 +75,7 @@ class NodeTraceBuffer : public TraceBuffer { | |||
// Used to wait until async handles have been closed. | |||
ConditionVariable exit_cond_; | |||
std::unique_ptr<NodeTraceWriter> trace_writer_; | |||
// TODO: Change std::atomic to something less contentious. | |||
// TODO(misterpoe) : Change std::atomic to something less contentious. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I've written in #14490 (comment), I'd put matthewloring
instead. Also, remove the space between )
and :
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, I used blame alone not dig upto PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
src/tracing/node_trace_writer.cc
Outdated
@@ -110,8 +110,8 @@ void NodeTraceWriter::FlushSignalCb(uv_async_t* signal) { | |||
trace_writer->FlushPrivate(); | |||
} | |||
|
|||
// TODO: Remove (is it necessary to change the API? Since because of WriteSuffix | |||
// it no longer matters whether it's true or false) | |||
// TODO(misterpoe) : Remove (is it necessary to change the API? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done !
src/tracing/node_trace_writer.cc
Outdated
uv_close(reinterpret_cast<uv_handle_t*>(&trace_writer->exit_signal_), | ||
[](uv_handle_t* signal) { | ||
NodeTraceWriter* trace_writer = | ||
static_cast<NodeTraceWriter*>(signal->data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto, use 4 spaces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
src/tracing/trace_event.h
Outdated
static inline void SetTraceValue(v8::ConvertableToTraceFormat* convertable_value, | ||
unsigned char* type, uint64_t* value) { | ||
static inline void SetTraceValue( | ||
v8::ConvertableToTraceFormat* convertable_value, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4 space indent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
29638c6
to
591a366
Compare
src/tracing/node_trace_buffer.cc
Outdated
uv_close(reinterpret_cast<uv_handle_t*>(&buffer->exit_signal_), | ||
[](uv_handle_t* signal) { | ||
NodeTraceBuffer* buffer = | ||
reinterpret_cast<NodeTraceBuffer*>(signal->data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still not changed.
src/tracing/node_trace_writer.cc
Outdated
uv_close(reinterpret_cast<uv_handle_t*>(&trace_writer->exit_signal_), | ||
[](uv_handle_t* signal) { | ||
NodeTraceWriter* trace_writer = | ||
static_cast<NodeTraceWriter*>(signal->data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
src/tracing/trace_event.h
Outdated
static inline void SetTraceValue(v8::ConvertableToTraceFormat* convertable_value, | ||
unsigned char* type, uint64_t* value) { | ||
static inline void SetTraceValue( | ||
v8::ConvertableToTraceFormat* convertable_value, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
I did the suggested changes, there is no style guide for indentation I affraid, so I used another properly indented one code to verify the changes @TimothyGu |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to exclude specific files from the linter? src/tracing/trace_event.h and src/tracing/trace_event_common.h are slightly modified copies of V8 files and it would be good to avoid complicating their diffs. Overall the changes look fine. Thank you for cleaning this up.
src/tracing/node_trace_buffer.h
Outdated
@@ -75,7 +75,7 @@ class NodeTraceBuffer : public TraceBuffer { | |||
// Used to wait until async handles have been closed. | |||
ConditionVariable exit_cond_; | |||
std::unique_ptr<NodeTraceWriter> trace_writer_; | |||
// TODO: Change std::atomic to something less contentious. | |||
// TODO(matthewloring): Change std::atomic to something less contentious. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not required as part of this change but this TODO is no longer necessary. We thought this might cause issues when the initial PR was reviewed but it ended up not being problematic.
@matthewloring Sure. @Jeyanthinath You can exclude certain files by adding them to the # These files were copied more or less verbatim from V8.
CPPLINT_EXCLUDE += src/tracing/trace_event.h src/tracing/trace_event_common.h Search for I believe this PR will be ready to be merged once you fix that and remove the TODO @matthewloring mentioned. 🥇 |
6bbf635
to
76c5179
Compare
@Jeyanthinath Thanks for adding the exclusions, but you should also revert the changes from those files as @matthewloring requested :/ |
@@ -110,8 +110,8 @@ void NodeTraceWriter::FlushSignalCb(uv_async_t* signal) { | |||
trace_writer->FlushPrivate(); | |||
} | |||
|
|||
// TODO: Remove (is it necessary to change the API? Since because of WriteSuffix | |||
// it no longer matters whether it's true or false) | |||
// TODO(matthewloring): Remove (is it necessary to change the API? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TimothyGu @matthewloring Is this is also needs to be removed ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, that one should stay in to remind me to clean up some of this. Thanks for checking!
@TimothyGu I guess I have made the changes as you guys pointed out, removing on TODO from the file he mentioned, is there anything pending ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reaffirm
@Jeyanthinath Sorry, I meant reverting the changes you've done to Also for your next PR, please use our commit message guidelines, so for this specific PR you would write something like:
Don't worry about it for this specific PR though, I've landed this with those two mini-issues fixed in e88908d. |
Fixes: nodejs#14490 PR-URL: nodejs#14497 Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Khaidi Chu <[email protected]> Reviewed-By: Refael Ackermann <[email protected]>
Fixes: #14490 PR-URL: #14497 Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Khaidi Chu <[email protected]> Reviewed-By: Refael Ackermann <[email protected]>
Most of the files included in this change do not appear to be on the v6.x branch. Please feel free to change the label and update if neccessary |
fix: #14490
Added one more CppLinting path in src/tracing in makefile
checks: