-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
fix(clang-tidy): Enable clang-tidy else-after-return and redundant void checks #3080
fix(clang-tidy): Enable clang-tidy else-after-return and redundant void checks #3080
Conversation
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.
Awesome :-)
include/pybind11/cast.h
Outdated
@@ -555,9 +563,8 @@ template <template<typename...> class Tuple, typename... Ts> class tuple_caster | |||
if (!src) return none().release(); | |||
if (policy == return_value_policy::take_ownership) { | |||
auto h = cast(std::move(*src), policy, parent); delete src; return 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.
Could you please also move the delete
and return
to separate lines while you're at it?
I had to squint at this for a while until I finally noticed the return 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.
@rwgk Done.
Since I can't assign reviewers yet, ping @henryiii |
…g-tidy-readability-else-after
ReOpen to retrigger |
@henryiii in the meantime I ran this through the Google-global testing: no issues. |
…r the just-merged PR pybind#3080. Also rerunning clang-format-diff.py to pick up a few fixes missed before.
Description
Suggested changelog entry:
* Add clang-tidy checks to further guard code style and remove all else after returns for better code readability. Also encourages following llvm-style (no ``else-after-returns``, proper usage of virtual functions in ctors and dtors).