diff --git a/impeller/renderer/testing/mocks.h b/impeller/renderer/testing/mocks.h index 00908671367d1..4af4bc1191e04 100644 --- a/impeller/renderer/testing/mocks.h +++ b/impeller/renderer/testing/mocks.h @@ -105,7 +105,7 @@ class MockRenderPass : public RenderPass { class MockCommandBuffer : public CommandBuffer { public: explicit MockCommandBuffer(std::weak_ptr context) - : CommandBuffer(context) {} + : CommandBuffer(std::move(context)) {} MOCK_METHOD(bool, IsValid, (), (const, override)); MOCK_METHOD(void, SetLabel, (const std::string& label), (const, override)); MOCK_METHOD(std::shared_ptr, OnCreateBlitPass, (), (override)); diff --git a/shell/platform/linux/fl_engine_private.h b/shell/platform/linux/fl_engine_private.h index 4b0227a62750a..cc8a55b2111ee 100644 --- a/shell/platform/linux/fl_engine_private.h +++ b/shell/platform/linux/fl_engine_private.h @@ -21,7 +21,9 @@ G_BEGIN_DECLS */ typedef enum { + // NOLINTBEGIN(readability-identifier-naming) FL_ENGINE_ERROR_FAILED, + // NOLINTEND(readability-identifier-naming) } FlEngineError; GQuark fl_engine_error_quark(void) G_GNUC_CONST; diff --git a/shell/platform/linux/fl_renderer.h b/shell/platform/linux/fl_renderer.h index d5db38cd0b5be..16f2cbf540ac7 100644 --- a/shell/platform/linux/fl_renderer.h +++ b/shell/platform/linux/fl_renderer.h @@ -20,7 +20,9 @@ G_BEGIN_DECLS */ typedef enum { + // NOLINTBEGIN(readability-identifier-naming) FL_RENDERER_ERROR_FAILED, + // NOLINTEND(readability-identifier-naming) } FlRendererError; GQuark fl_renderer_error_quark(void) G_GNUC_CONST; diff --git a/shell/platform/linux/fl_settings.h b/shell/platform/linux/fl_settings.h index 4453fd86196ce..f7305f1876d51 100644 --- a/shell/platform/linux/fl_settings.h +++ b/shell/platform/linux/fl_settings.h @@ -19,8 +19,10 @@ G_DECLARE_INTERFACE(FlSettings, fl_settings, FL, SETTINGS, GObject) * Available clock formats. */ typedef enum { + // NOLINTBEGIN(readability-identifier-naming) FL_CLOCK_FORMAT_12H, FL_CLOCK_FORMAT_24H, + // NOLINTEND(readability-identifier-naming) } FlClockFormat; /** @@ -31,8 +33,10 @@ typedef enum { * Available color schemes. */ typedef enum { + // NOLINTBEGIN(readability-identifier-naming) FL_COLOR_SCHEME_LIGHT, FL_COLOR_SCHEME_DARK, + // NOLINTEND(readability-identifier-naming) } FlColorScheme; /** diff --git a/shell/platform/linux/public/flutter_linux/fl_json_message_codec.h b/shell/platform/linux/public/flutter_linux/fl_json_message_codec.h index a24075950bd85..d6f99beddea07 100644 --- a/shell/platform/linux/public/flutter_linux/fl_json_message_codec.h +++ b/shell/platform/linux/public/flutter_linux/fl_json_message_codec.h @@ -27,9 +27,11 @@ G_BEGIN_DECLS #define FL_JSON_MESSAGE_CODEC_ERROR fl_json_message_codec_error_quark() typedef enum { + // NOLINTBEGIN(readability-identifier-naming) FL_JSON_MESSAGE_CODEC_ERROR_INVALID_UTF8, FL_JSON_MESSAGE_CODEC_ERROR_INVALID_JSON, FL_JSON_MESSAGE_CODEC_ERROR_INVALID_OBJECT_KEY_TYPE, + // NOLINTEND(readability-identifier-naming) } FlJsonMessageCodecError; GQuark fl_json_message_codec_error_quark(void) G_GNUC_CONST; diff --git a/shell/platform/linux/public/flutter_linux/fl_message_codec.h b/shell/platform/linux/public/flutter_linux/fl_message_codec.h index 451a6eaba7ad7..0fefb40efddb5 100644 --- a/shell/platform/linux/public/flutter_linux/fl_message_codec.h +++ b/shell/platform/linux/public/flutter_linux/fl_message_codec.h @@ -30,10 +30,12 @@ G_BEGIN_DECLS #define FL_MESSAGE_CODEC_ERROR fl_message_codec_error_quark() typedef enum { + // NOLINTBEGIN(readability-identifier-naming) FL_MESSAGE_CODEC_ERROR_FAILED, FL_MESSAGE_CODEC_ERROR_OUT_OF_DATA, FL_MESSAGE_CODEC_ERROR_ADDITIONAL_DATA, FL_MESSAGE_CODEC_ERROR_UNSUPPORTED_TYPE, + // NOLINTEND(readability-identifier-naming) } FlMessageCodecError; GQuark fl_message_codec_error_quark(void) G_GNUC_CONST; diff --git a/shell/platform/linux/public/flutter_linux/fl_method_response.h b/shell/platform/linux/public/flutter_linux/fl_method_response.h index 2306c3e2ea611..780ee5e675f73 100644 --- a/shell/platform/linux/public/flutter_linux/fl_method_response.h +++ b/shell/platform/linux/public/flutter_linux/fl_method_response.h @@ -30,9 +30,11 @@ G_BEGIN_DECLS #define FL_METHOD_RESPONSE_ERROR fl_method_response_error_quark() typedef enum { + // NOLINTBEGIN(readability-identifier-naming) FL_METHOD_RESPONSE_ERROR_FAILED, FL_METHOD_RESPONSE_ERROR_REMOTE_ERROR, FL_METHOD_RESPONSE_ERROR_NOT_IMPLEMENTED, + // NOLINTEND(readability-identifier-naming) } FlMethodResponseError; GQuark fl_method_response_error_quark(void) G_GNUC_CONST; diff --git a/shell/platform/linux/testing/mock_binary_messenger.cc b/shell/platform/linux/testing/mock_binary_messenger.cc index eacbee1d6e27c..ac1b05af3386a 100644 --- a/shell/platform/linux/testing/mock_binary_messenger.cc +++ b/shell/platform/linux/testing/mock_binary_messenger.cc @@ -40,26 +40,26 @@ MockBinaryMessenger::operator FlBinaryMessenger*() { } bool MockBinaryMessenger::HasMessageHandler(const gchar* channel) const { - return message_handlers.at(channel) != nullptr; + return message_handlers_.at(channel) != nullptr; } void MockBinaryMessenger::SetMessageHandler( const gchar* channel, FlBinaryMessengerMessageHandler handler, gpointer user_data) { - message_handlers[channel] = handler; - user_datas[channel] = user_data; + message_handlers_[channel] = handler; + user_datas_[channel] = user_data; } void MockBinaryMessenger::ReceiveMessage(const gchar* channel, GBytes* message) { - FlBinaryMessengerMessageHandler handler = message_handlers[channel]; - if (response_handles[channel] == nullptr) { - response_handles[channel] = FL_BINARY_MESSENGER_RESPONSE_HANDLE( + FlBinaryMessengerMessageHandler handler = message_handlers_[channel]; + if (response_handles_[channel] == nullptr) { + response_handles_[channel] = FL_BINARY_MESSENGER_RESPONSE_HANDLE( fl_mock_binary_messenger_response_handle_new()); } - handler(instance_, channel, message, response_handles[channel], - user_datas[channel]); + handler(instance_, channel, message, response_handles_[channel], + user_datas_[channel]); } static void fl_mock_binary_messenger_iface_init( diff --git a/shell/platform/linux/testing/mock_binary_messenger.h b/shell/platform/linux/testing/mock_binary_messenger.h index 61761276a8d88..394e55882ed2d 100644 --- a/shell/platform/linux/testing/mock_binary_messenger.h +++ b/shell/platform/linux/testing/mock_binary_messenger.h @@ -20,6 +20,10 @@ class MockBinaryMessenger { MockBinaryMessenger(); ~MockBinaryMessenger(); + // This was an existing use of operator overloading. It's against our style + // guide but enabling clang tidy on header files is a higher priority than + // fixing this. + // NOLINTNEXTLINE(google-explicit-constructor) operator FlBinaryMessenger*(); MOCK_METHOD(void, @@ -75,10 +79,10 @@ class MockBinaryMessenger { private: FlBinaryMessenger* instance_ = nullptr; std::unordered_map - message_handlers; + message_handlers_; std::unordered_map - response_handles; - std::unordered_map user_datas; + response_handles_; + std::unordered_map user_datas_; }; } // namespace testing diff --git a/shell/platform/linux/testing/mock_im_context.h b/shell/platform/linux/testing/mock_im_context.h index 212631b78d1e2..243030cc8ac0e 100644 --- a/shell/platform/linux/testing/mock_im_context.h +++ b/shell/platform/linux/testing/mock_im_context.h @@ -16,6 +16,10 @@ class MockIMContext { public: ~MockIMContext(); + // This was an existing use of operator overloading. It's against our style + // guide but enabling clang tidy on header files is a higher priority than + // fixing this. + // NOLINTNEXTLINE(google-explicit-constructor) operator GtkIMContext*(); MOCK_METHOD(void, diff --git a/shell/platform/linux/testing/mock_settings.h b/shell/platform/linux/testing/mock_settings.h index 51f882b80e511..790229eb8c795 100644 --- a/shell/platform/linux/testing/mock_settings.h +++ b/shell/platform/linux/testing/mock_settings.h @@ -18,6 +18,10 @@ class MockSettings { MockSettings(); ~MockSettings(); + // This was an existing use of operator overloading. It's against our style + // guide but enabling clang tidy on header files is a higher priority than + // fixing this. + // NOLINTNEXTLINE(google-explicit-constructor) operator FlSettings*(); MOCK_METHOD(FlClockFormat, diff --git a/vulkan/vulkan_application.cc b/vulkan/vulkan_application.cc index 47cbf3ec29eca..ea8129534f9a5 100644 --- a/vulkan/vulkan_application.cc +++ b/vulkan/vulkan_application.cc @@ -20,13 +20,13 @@ VulkanApplication::VulkanApplication( uint32_t application_version, uint32_t api_version, bool enable_validation_layers) - : vk(p_vk), + : vk_(p_vk), api_version_(api_version), valid_(false), enable_validation_layers_(enable_validation_layers) { // Check if we want to enable debugging. std::vector supported_extensions = - GetSupportedInstanceExtensions(vk); + GetSupportedInstanceExtensions(vk_); bool enable_instance_debugging = enable_validation_layers_ && ExtensionSupported(supported_extensions, @@ -59,7 +59,7 @@ VulkanApplication::VulkanApplication( // Configure layers. const std::vector enabled_layers = - InstanceLayersToEnable(vk, enable_validation_layers_); + InstanceLayersToEnable(vk_, enable_validation_layers_); const char* layers[enabled_layers.size()]; @@ -94,14 +94,14 @@ VulkanApplication::VulkanApplication( VkInstance instance = VK_NULL_HANDLE; - if (VK_CALL_LOG_ERROR(vk.CreateInstance(&create_info, nullptr, &instance)) != + if (VK_CALL_LOG_ERROR(vk_.CreateInstance(&create_info, nullptr, &instance)) != VK_SUCCESS) { FML_DLOG(INFO) << "Could not create application instance."; return; } // Now that we have an instance, set up instance proc table entries. - if (!vk.SetupInstanceProcAddresses(VulkanHandle(instance))) { + if (!vk_.SetupInstanceProcAddresses(VulkanHandle(instance))) { FML_DLOG(INFO) << "Could not set up instance proc addresses."; return; } @@ -109,11 +109,11 @@ VulkanApplication::VulkanApplication( instance_ = VulkanHandle{instance, [this](VkInstance i) { FML_DLOG(INFO) << "Destroying Vulkan instance"; - vk.DestroyInstance(i, nullptr); + vk_.DestroyInstance(i, nullptr); }}; if (enable_instance_debugging) { - auto debug_report = std::make_unique(vk, instance_); + auto debug_report = std::make_unique(vk_, instance_); if (!debug_report->IsValid()) { FML_DLOG(INFO) << "Vulkan debugging was enabled but could not be set up " "for this instance."; @@ -150,8 +150,8 @@ std::vector VulkanApplication::GetPhysicalDevices() const { } uint32_t device_count = 0; - if (VK_CALL_LOG_ERROR(vk.EnumeratePhysicalDevices(instance_, &device_count, - nullptr)) != VK_SUCCESS) { + if (VK_CALL_LOG_ERROR(vk_.EnumeratePhysicalDevices(instance_, &device_count, + nullptr)) != VK_SUCCESS) { FML_DLOG(INFO) << "Could not enumerate physical device."; return {}; } @@ -166,7 +166,7 @@ std::vector VulkanApplication::GetPhysicalDevices() const { physical_devices.resize(device_count); - if (VK_CALL_LOG_ERROR(vk.EnumeratePhysicalDevices( + if (VK_CALL_LOG_ERROR(vk_.EnumeratePhysicalDevices( instance_, &device_count, physical_devices.data())) != VK_SUCCESS) { FML_DLOG(INFO) << "Could not enumerate physical device."; return {}; @@ -179,7 +179,7 @@ std::unique_ptr VulkanApplication::AcquireFirstCompatibleLogicalDevice() const { for (auto device_handle : GetPhysicalDevices()) { auto logical_device = std::make_unique( - vk, VulkanHandle(device_handle), + vk_, VulkanHandle(device_handle), enable_validation_layers_); if (logical_device->IsValid()) { return logical_device; diff --git a/vulkan/vulkan_application.h b/vulkan/vulkan_application.h index 06c437caffe0e..b30e49c0b2463 100644 --- a/vulkan/vulkan_application.h +++ b/vulkan/vulkan_application.h @@ -44,7 +44,7 @@ class VulkanApplication { std::unique_ptr AcquireFirstCompatibleLogicalDevice() const; private: - VulkanProcTable& vk; + VulkanProcTable& vk_; VulkanHandle instance_; uint32_t api_version_; std::unique_ptr debug_report_;