Skip to content
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

Closed
wants to merge 7 commits into from

Conversation

Jeyanthinath
Copy link
Contributor

@Jeyanthinath Jeyanthinath commented Jul 26, 2017

fix: #14490

Added one more CppLinting path in src/tracing in makefile

checks:

  • Make CppLint

@nodejs-github-bot nodejs-github-bot added the build Issues and PRs related to build files or the CI. label Jul 26, 2017
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 \
Copy link
Member

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.

Copy link
Contributor Author

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

@XadillaX
Copy link
Member

XadillaX commented Jul 27, 2017

Have you ever done CPPLint locally and passed after you modifying the configuration?

Copy link
Member

@XadillaX XadillaX left a 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.

Copy link
Member

@TimothyGu TimothyGu left a 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.

@Jeyanthinath
Copy link
Contributor Author

Jeyanthinath commented Jul 27, 2017

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

uv_close(reinterpret_cast<uv_handle_t*>(&buffer->exit_signal_),
[](uv_handle_t* signal) {
NodeTraceBuffer* buffer =
reinterpret_cast<NodeTraceBuffer*>(signal->data);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Four-space indentation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@@ -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.
Copy link
Member

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 :.

Copy link
Contributor Author

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@@ -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?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done !

uv_close(reinterpret_cast<uv_handle_t*>(&trace_writer->exit_signal_),
[](uv_handle_t* signal) {
NodeTraceWriter* trace_writer =
static_cast<NodeTraceWriter*>(signal->data);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto, use 4 spaces.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

static inline void SetTraceValue(v8::ConvertableToTraceFormat* convertable_value,
unsigned char* type, uint64_t* value) {
static inline void SetTraceValue(
v8::ConvertableToTraceFormat* convertable_value,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 space indent

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

uv_close(reinterpret_cast<uv_handle_t*>(&buffer->exit_signal_),
[](uv_handle_t* signal) {
NodeTraceBuffer* buffer =
reinterpret_cast<NodeTraceBuffer*>(signal->data);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still not changed.

uv_close(reinterpret_cast<uv_handle_t*>(&trace_writer->exit_signal_),
[](uv_handle_t* signal) {
NodeTraceWriter* trace_writer =
static_cast<NodeTraceWriter*>(signal->data);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

static inline void SetTraceValue(v8::ConvertableToTraceFormat* convertable_value,
unsigned char* type, uint64_t* value) {
static inline void SetTraceValue(
v8::ConvertableToTraceFormat* convertable_value,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

@TimothyGu TimothyGu self-assigned this Jul 31, 2017
@Jeyanthinath
Copy link
Contributor Author

Jeyanthinath commented Aug 1, 2017

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

@TimothyGu
Copy link
Member

@TimothyGu
Copy link
Member

@refack
Copy link
Contributor

refack commented Aug 1, 2017

/cc @misterpoe @matthewloring

Copy link

@matthewloring matthewloring left a 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.

@@ -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.

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.

@TimothyGu
Copy link
Member

@matthewloring Sure.

@Jeyanthinath You can exclude certain files by adding them to the CPPLINT_EXCLUDE variable, like so:

# 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 CPPLINT_EXCLUDE in Makefile and put the lines above near the existing exclusions.

I believe this PR will be ready to be merged once you fix that and remove the TODO @matthewloring mentioned. 🥇

@TimothyGu
Copy link
Member

@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?
Copy link
Contributor Author

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 ?

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!

@Jeyanthinath
Copy link
Contributor Author

@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 ?

Copy link
Contributor

@refack refack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reaffirm

@XadillaX
Copy link
Member

XadillaX commented Aug 6, 2017

@TimothyGu
Copy link
Member

TimothyGu commented Aug 7, 2017

@Jeyanthinath Sorry, I meant reverting the changes you've done to src/tracing/trace_event.h and src/tracing/trace_event_common.h.

Also for your next PR, please use our commit message guidelines, so for this specific PR you would write something like:

build: enable C++ linting for src/*/*

Fixes: https://github.com/nodejs/node/issues/14490

Don't worry about it for this specific PR though, I've landed this with those two mini-issues fixed in e88908d.

@TimothyGu TimothyGu closed this Aug 7, 2017
TimothyGu pushed a commit to TimothyGu/node that referenced this pull request Aug 7, 2017
Fixes: nodejs#14490
PR-URL: nodejs#14497
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Refael Ackermann <refack@gmail.com>
addaleax pushed a commit that referenced this pull request Aug 7, 2017
Fixes: #14490
PR-URL: #14497
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Refael Ackermann <refack@gmail.com>
@MylesBorins
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

C++ linter is not run on src/*/*
7 participants