-
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
Final manual curation in preparation for global clang-format
ing
#3712
Conversation
@@ -44,10 +44,12 @@ struct buffer_info { | |||
void *ptr = nullptr; // Pointer to the underlying storage | |||
ssize_t itemsize = 0; // Size of individual items in bytes | |||
ssize_t size = 0; // Total number of entries | |||
std::string format; // For homogeneous buffers, this should be set to format_descriptor<T>::format() | |||
std::string format; // For homogeneous buffers, this should be set to |
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.
FWIW, for these sorts of things, I'd do something like:
<empty line>
// Comment
std::string thing;
That will format much better, remain readable, and use less horizontal space for some extra vertical space.
No need to do that now. But that would be my general solution.
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.
Totally agree.
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 was going back and forth myself exactly here, then decided clang-format is actually doing a very nice job, preserving the original intent (no semi-pun intended). It's not obvious here, but if you look under #3713 it's great there. — But I'm happy to change it around. What do you prefer? Put only some comments on top, as needed? Or all, systematically?
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.
Let's go with that then. Merge at your discretion.
// Placeholder type for the unneeded (and dead code) static variable in the | ||
// PYBIND11_OVERRIDE_OVERRIDE macro | ||
struct override_unused {}; |
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.
Like this. :)
Informed by work under pybind#3683: pybind@60b7eb4 pybind@59572e6
Very labor-intensive and dull.
413a047
to
a1c898f
Compare
Description
After this PR is merged we are ready for the last fully-automatic step: PR #3713.
Informed by experimental work under #3708, which is this PR + clang-format in pre-commit.
Suggested changelog entry: