Skip to content

tidy: fix master#10661

Merged
mattklein123 merged 4 commits intoenvoyproxy:masterfrom
lizan:tidy_fixes
Apr 7, 2020
Merged

tidy: fix master#10661
mattklein123 merged 4 commits intoenvoyproxy:masterfrom
lizan:tidy_fixes

Conversation

@lizan
Copy link
Member

@lizan lizan commented Apr 6, 2020

Signed-off-by: Lizan Zhou lizan@tetrate.io

Description:
Fix clang-tidy error on master. Except readability-identifier-naming which causes too many function rename.

Risk Level: Low
Testing: CI
Docs Changes: N/A
Release Notes: N/A

Signed-off-by: Lizan Zhou <lizan@tetrate.io>
Copy link
Contributor

@jmarantz jmarantz left a comment

Choose a reason for hiding this comment

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

Looks good with one question about Chromium source.

template <typename T> class CanonOutputT {
public:
CanonOutputT() : buffer_(NULL), buffer_len_(0), cur_len_(0) {}
CanonOutputT() : buffer_(NULL) {}
Copy link
Contributor

Choose a reason for hiding this comment

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

s/NULL/nullptr/ and also make this an initializer like *_len_ -- but only if we are going to continue to apply clang-tidy to this Chromium code.


#include <stdlib.h>
#include <string.h>
#include <cstdlib>
Copy link
Contributor

Choose a reason for hiding this comment

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

higher level question for this file: this is obviously not written for Envoy, but appears to be forked from Chromium, I'm assuming because depending on its upstream was not tractable.

But rather than bringing it into our coding style, should we add a third_party directory where we hold forked sources, and do not apply our current clang-tidy standards or naming conventions?

There's at least a few other Envoy naming-style divergences in this file as well, but it doesn't seem to make sense to fix them.

In fact all of the changes suggested here might make it harder to manually pull from Chromium later on if we decide we need to.

Copy link
Member

Choose a reason for hiding this comment

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

+1 can we exclude this code?

Copy link
Member

Choose a reason for hiding this comment

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

FWIW, we're not far away from being able to use the GURL library directly for this thanks to #10599. So, if we can easily skip, that could simplify.

@jmarantz jmarantz self-assigned this Apr 6, 2020
Signed-off-by: Lizan Zhou <lizan@tetrate.io>
jmarantz
jmarantz previously approved these changes Apr 6, 2020
Copy link
Contributor

@jmarantz jmarantz left a comment

Choose a reason for hiding this comment

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

with the chromium edits gone, lgtm & thanks!

@lizan
Copy link
Member Author

lizan commented Apr 6, 2020

/azp run envoy-presubmit

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mattklein123
Copy link
Member

I think you might need a master merge since stats integration test is failing.

/wait

Signed-off-by: Lizan Zhou <lizan@tetrate.io>
Signed-off-by: Lizan Zhou <lizan@tetrate.io>
@lizan
Copy link
Member Author

lizan commented Apr 7, 2020

This actually saves memory per cluster. I think it is because of the use of std::make_shared because it is more efficient than shared_ptr constructor by reducing heap allocation.

@mattklein123
Copy link
Member

This actually saves memory per cluster. I think it is because of the use of std::make_shared because it is more efficient than shared_ptr constructor by reducing heap allocation.

Nice!

@mattklein123
Copy link
Member

@lizan there are still tidy errors but I'm going to go ahead and merge this to avoid further creep. We can continue to do follow ups. Thank you!

@mattklein123 mattklein123 merged commit 3adf14a into envoyproxy:master Apr 7, 2020
@lizan
Copy link
Member Author

lizan commented Apr 7, 2020

@mattklein123 thanks. tidy errors are expected as I'm not fixing readability-identifier-naming and those not automatically fixable by clang-apply-replacements.

@lizan lizan deleted the tidy_fixes branch April 7, 2020 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants