Skip to content

maint(clang-tidy): Improve code readability with explicit boolean casts - #3148

Merged
rwgk merged 9 commits into
pybind:masterfrom
Skylion007:clang-tidy-readability-bool
Jul 27, 2021
Merged

maint(clang-tidy): Improve code readability with explicit boolean casts#3148
rwgk merged 9 commits into
pybind:masterfrom
Skylion007:clang-tidy-readability-bool

Conversation

@Skylion007

Copy link
Copy Markdown
Collaborator

Description

  • This adds some non-controversial clang-tidy checks that improve code readability. Mainly requiring boolean conversions to be more explicit and using modern syntax for making shared or unique along with other modern C++ language features. Many of these checks don't actually change that much of the code,

Suggested changelog entry:

* Add clang-tidy-readability rules to make boolean casts explicit improving code readability. Also enabled other misc and readability clang-tidy checks.

Comment threadtests/test_smart_ptr.cpp
Comment threadinclude/pybind11/cast.h Outdated
Comment threadtests/test_methods_and_attributes.cpp Outdated
Comment threadtests/test_smart_ptr.cpp
Comment threadinclude/pybind11/numpy.h

@rwgkrwgk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

That's really awesome now!

@rwgk

rwgk commented Jul 27, 2021

Copy link
Copy Markdown
Collaborator

@Skylion007 I'll go ahead merging this now (and then #3135, and then update the smart_holder branch, and then import everything into the google environment :-) )

@rwgk
rwgk merged commit 9beaa92 into pybind:masterJul 27, 2021
@github-actionsgithub-actionsBot added the needs changelog Possibly needs a changelog entry label Jul 27, 2021
rwgk added a commit to rwgk/pybind11 that referenced this pull request Jul 27, 2021
henryiii pushed a commit to henryiii/pybind11 that referenced this pull request Jul 29, 2021
…ts (pybind#3148)
* maint(clang-tidy) Improve code readability
* Fix minor typos
* Revert optimization that removed test case
* Fix comment formatting
* Revert another optimization to repro an issue
* Remove make_unique since it C++14 and newer only
* eformat comments
* Fix unsignedness of comparison
* Update comment
@henryiiihenryiii removed the needs changelog Possibly needs a changelog entry label Sep 16, 2021
@rwgkrwgk mentioned this pull request Feb 10, 2023
Sign up for freeto 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

@Skylion007@rwgk@henryiii