-
Notifications
You must be signed in to change notification settings - Fork 419
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
[clang-tidy] enable google-build-using-namespace #359
Conversation
src/esp/bindings/bindings.cpp
Outdated
using esp::sensor::Sensor; | ||
using esp::sensor::SensorSpec; | ||
using esp::sensor::SensorSuite; | ||
using esp::sensor::SensorType; |
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.
Do we need this, considering we scatter the bindings across multiple modules again on the Python side? To make it easier on both sides, I would say best would be to have gfx
, physics
, scene
, ... submodules generated in the bindings (without using using
, so it's clear through which submodule should given API be exposed) and then making use of those on the Python
side instead of have things manually cherry-picked via __all__
.
Of course there's a question whether this should be done as a part of this PR or separately, but based on previous experience the tech debt TODOs tend to stay in the code forever and so I'd say it should be in this PR. After all, the purpose of this PR is to fix the root cause of the Clang Tidy warnings, not merely silencing them, right? :)
@@ -43,6 +43,7 @@ struct DepthUnprojectionTest : Mn::GL::OpenGLTester { | |||
void benchmarkGpuUnprojectExisting(); | |||
}; | |||
|
|||
// NOLINTNEXTLINE(google-build-using-namespace) | |||
using namespace Mn::Math::Literals; |
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 there anything I can do on the engine side to not need to have this annotation in every source file that uses the literals? How does Clang Tidy behave with using namespace std::chrono::literals
? Do you need to do the same or is there something that whitelists that namespace?
You likely need to add
everywhere |
Gotcha. Thanks! |
All feedback addressed and tests now passing. |
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.
Thank you!
Btw, did you notice any build speed improvements when the bindings got separated like this?
@@ -25,6 +25,9 @@ | |||
namespace Cr = Corrade; | |||
namespace Mn = Magnum; | |||
|
|||
using Mn::Math::Literals::operator""_degf; | |||
using Mn::Math::Literals::operator""_rgbf; |
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.
I still don't agree with Tidy about this one, but I guess we can't do any better.
Found https://reviews.llvm.org/D33010 that makes the check not complain for standard literals, but such hardcoded unextendable whitelisting makes me kinda angry :/
I think LTO is the most time consuming part of the bindings. Building the |
Motivation and Context
Enable one more clang-tidy check.
How Has This Been Tested
Build.
Types of changes
Checklist