Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Add 'explicit' to darwin embedder constructors #29827

Merged
merged 3 commits into from
Nov 19, 2021
Merged

Conversation

jmagman
Copy link
Member

@jmagman jmagman commented Nov 19, 2021

Add explicit to constructor declarations in macOS host_debug and ios_debug

Include headers using header filter regex:

Checks: '-*,google-explicit-constructor'
WarningsAsErrors: '-*,google-explicit-constructor'
HeaderFilterRegex: '.*/flutter/.*h$'

https://clang.llvm.org/extra/clang-tidy/checks/google-explicit-constructor.html

macOS and iOS version of #29741
For flutter/flutter#93576

@jmagman jmagman self-assigned this Nov 19, 2021
@google-cla google-cla bot added the cla: yes label Nov 19, 2021
@jmagman jmagman force-pushed the explicit branch 3 times, most recently from 9b6b41b to befd4e1 Compare November 19, 2021 02:14
@jmagman jmagman changed the title Add 'explicit' to darwin header files Add 'explicit' to darwin and Android embedder constructors Nov 19, 2021
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@jmagman jmagman changed the title Add 'explicit' to darwin and Android embedder constructors Add 'explicit' to macOS and Android embedder constructors Nov 19, 2021
@jmagman jmagman marked this pull request as draft November 19, 2021 02:47
@jmagman jmagman changed the title Add 'explicit' to macOS and Android embedder constructors Add 'explicit' to macOS embedder constructors Nov 19, 2021
@jmagman jmagman marked this pull request as ready for review November 19, 2021 03:02
@jmagman jmagman changed the title Add 'explicit' to macOS embedder constructors Add 'explicit' to darwin embedder constructors Nov 19, 2021
@jmagman jmagman requested a review from zanderso November 19, 2021 03:30
@@ -23,8 +23,10 @@ struct TextEditingDelta {
TextRange range,
const std::string& text);

// NOLINTNEXTLINE(google-explicit-constructor)
Copy link
Member

Choose a reason for hiding this comment

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

I don't know how painful it would be, but I think these two are cases where we would want to have explicit.

Copy link
Member Author

Choose a reason for hiding this comment

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

It worked, in this case I was confused about which one was erroring.

Comment on lines 61 to 62
// NOLINTNEXTLINE(google-explicit-constructor)
operator bool() const { return instance_ != nullptr; }
Copy link
Member Author

Choose a reason for hiding this comment

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

This one should be explicit I think.

@jmagman jmagman added the waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land. label Nov 19, 2021
@jmagman
Copy link
Member Author

jmagman commented Nov 19, 2021

luci-engine status is wrong, infra is investigating. Tree is actually green, merging.

@jmagman jmagman merged commit d61bf8e into flutter:main Nov 19, 2021
@jmagman jmagman deleted the explicit branch November 19, 2021 18:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes needs tests platform-ios platform-macos waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants