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

maint(clang-tidy): Bugprone enable checks #3166

Merged
merged 22 commits into from
Aug 6, 2021

Conversation

Skylion007
Copy link
Collaborator

@Skylion007 Skylion007 commented Aug 2, 2021

Description

  • Enables additional clang-tidy checks for bugprone-behavior.

Suggested changelog entry:

* Enable most bugprone checks in clang-tidy and fix the found potential bugs and poor coding styles.

@Skylion007 Skylion007 requested a review from rwgk August 2, 2021 17:00
.clang-tidy Show resolved Hide resolved
include/pybind11/numpy.h Outdated Show resolved Hide resolved
@rwgk
Copy link
Collaborator

rwgk commented Aug 3, 2021

I just took a super quick look after seeing the emails about your last two commits. Does that mean enable_if isn't needed in this case, just deleting the copy and move constructors does the trick?

@Skylion007
Copy link
Collaborator Author

Skylion007 commented Aug 3, 2021

I just took a super quick look after seeing the emails about your last two commits. Does that mean enable_if isn't needed in this case, just deleting the copy and move constructors does the trick?

Unfortunately, the default copy and move destructors are actually used so I do need to do the enableif trick. It passes clang-tidy but fails compilation.

@Skylion007 Skylion007 marked this pull request as ready for review August 4, 2021 16:14
include/pybind11/embed.h Outdated Show resolved Hide resolved
@Skylion007
Copy link
Collaborator Author

@henryiii Ping. Would appreciated your feedback on this PR. :)

@rwgk
Copy link
Collaborator

rwgk commented Aug 5, 2021

ICC flaked, I don't remember seeing that exact flake before, but it's download related, it doesn't even get to the configure stage. Maybe just try again?
(I have one suggestion though (I think). Hang on.)

.clang-tidy Show resolved Hide resolved
include/pybind11/detail/common.h Outdated Show resolved Hide resolved
include/pybind11/detail/type_caster_base.h Outdated Show resolved Hide resolved
include/pybind11/gil.h Outdated Show resolved Hide resolved
include/pybind11/numpy.h Show resolved Hide resolved
tests/test_class.cpp Outdated Show resolved Hide resolved
@henryiii
Copy link
Collaborator

henryiii commented Aug 5, 2021

Looks good, would second @rwgk's suggestions; a couple of places need comments as to why they are doing what they are doing and bugprone-exception-escape is probably less confusing if handled in a different PR (though personally not highly against adding a nolint for it if you know it won't pass, even if it's not enabled, but fine to wait and I do see that seeing a no lint for something that is not being linted is likely quite confusing).

@Skylion007
Copy link
Collaborator Author

@henryiii Need your approval to merge. :)

Copy link
Collaborator

@rwgk rwgk left a comment

Choose a reason for hiding this comment

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

Thanks Aaron!

@rwgk
Copy link
Collaborator

rwgk commented Aug 6, 2021

Looks like you lost a comma in numpy.h.

@rwgk
Copy link
Collaborator

rwgk commented Aug 6, 2021

@henryiii Need your approval to merge. :)

We are already two maintainers.
This is pure code health.
I don't want to by-pass anyone, but to me this clearly is fine with just one approval.
Note that even in a shop like Google, where you could in theory bring down a service for billions, this is enough approvals coverage. Here we're just working on master codehealth.
Caveat: at Google we cannot submit with a broken CI. But I trust nobody would do that here.

@Skylion007 Skylion007 merged commit 3893f37 into pybind:master Aug 6, 2021
@Skylion007 Skylion007 deleted the bugprone-enable-checks branch August 6, 2021 18:30
@github-actions github-actions bot added the needs changelog Possibly needs a changelog entry label Aug 6, 2021
rwgk pushed a commit to rwgk/pybind11 that referenced this pull request Aug 14, 2021
@henryiii henryiii removed the needs changelog Possibly needs a changelog entry label Sep 16, 2021
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.

3 participants