diff --git a/ci/licenses_golden/excluded_files b/ci/licenses_golden/excluded_files index 7fa766c0acde5..2a674fe846230 100644 --- a/ci/licenses_golden/excluded_files +++ b/ci/licenses_golden/excluded_files @@ -371,6 +371,7 @@ ../../../flutter/shell/platform/glfw/client_wrapper/flutter_window_unittests.cc ../../../flutter/shell/platform/glfw/client_wrapper/plugin_registrar_glfw_unittests.cc ../../../flutter/shell/platform/glfw/client_wrapper/testing +../../../flutter/shell/platform/linux/.clang-tidy ../../../flutter/shell/platform/linux/testing ../../../flutter/shell/platform/windows/README.md ../../../flutter/shell/platform/windows/accessibility_bridge_windows_unittests.cc diff --git a/shell/platform/embedder/embedder.cc b/shell/platform/embedder/embedder.cc index 26214cbce7f94..95ca54327548c 100644 --- a/shell/platform/embedder/embedder.cc +++ b/shell/platform/embedder/embedder.cc @@ -2457,7 +2457,8 @@ FlutterEngineResult FlutterEngineSendPointerEvent( SAFE_ACCESS(current, signal_kind, kFlutterPointerSignalKindNone)); pointer_data.scroll_delta_x = SAFE_ACCESS(current, scroll_delta_x, 0.0); pointer_data.scroll_delta_y = SAFE_ACCESS(current, scroll_delta_y, 0.0); - FlutterPointerDeviceKind device_kind = SAFE_ACCESS(current, device_kind, 0); + FlutterPointerDeviceKind device_kind = + SAFE_ACCESS(current, device_kind, kFlutterPointerDeviceKindMouse); // For backwards compatibility with embedders written before the device // kind and buttons were exposed, if the device kind is not set treat it // as a mouse, with a synthesized primary button state based on the phase. diff --git a/shell/platform/embedder/tests/embedder_unittests.cc b/shell/platform/embedder/tests/embedder_unittests.cc index 7c108d9973bbb..fa44555ba67ab 100644 --- a/shell/platform/embedder/tests/embedder_unittests.cc +++ b/shell/platform/embedder/tests/embedder_unittests.cc @@ -2337,6 +2337,7 @@ TEST_F(EmbedderTest, InvalidAOTDataSourcesMustReturnError) { ASSERT_EQ(FlutterEngineCreateAOTData(&data_in, nullptr), kInvalidArguments); // Invalid FlutterEngineAOTDataSourceType type specified. + // NOLINTNEXTLINE(clang-analyzer-optin.core.EnumCastOutOfRange) data_in.type = static_cast(-1); ASSERT_EQ(FlutterEngineCreateAOTData(&data_in, &data_out), kInvalidArguments); ASSERT_EQ(data_out, nullptr); diff --git a/shell/platform/linux/.clang-tidy b/shell/platform/linux/.clang-tidy new file mode 100644 index 0000000000000..42d8632c23f39 --- /dev/null +++ b/shell/platform/linux/.clang-tidy @@ -0,0 +1,5 @@ +InheritParentConfig: true + +# EnumCastOutOfRange warns about some common usages of GTK macros +Checks: >- + -clang-analyzer-optin.core.EnumCastOutOfRange