From ed456a4695ed271c45384fdd0a7f30c0541aaa01 Mon Sep 17 00:00:00 2001 From: Matan Lurey Date: Fri, 17 Nov 2023 17:06:05 -0800 Subject: [PATCH] Make `shell/platform/{darwin|embedder}/...` compatible with `.clang-tidy`. (#48160) --- .../darwin/common/framework/Headers/FlutterCodecs.h | 2 ++ .../common/framework/Source/FlutterStandardCodecHelper.h | 8 ++++++++ shell/platform/embedder/embedder.h | 4 ++++ shell/platform/embedder/tests/embedder_assertions.h | 4 ++++ shell/platform/embedder/tests/embedder_unittests_util.h | 5 +++-- 5 files changed, 21 insertions(+), 2 deletions(-) diff --git a/shell/platform/darwin/common/framework/Headers/FlutterCodecs.h b/shell/platform/darwin/common/framework/Headers/FlutterCodecs.h index f7117f01ffb7a..be7e34cc7634d 100644 --- a/shell/platform/darwin/common/framework/Headers/FlutterCodecs.h +++ b/shell/platform/darwin/common/framework/Headers/FlutterCodecs.h @@ -279,11 +279,13 @@ FLUTTER_DARWIN_EXPORT * - FlutterStandardDataTypeFloat64: 64-bit floats */ typedef NS_ENUM(NSInteger, FlutterStandardDataType) { + // NOLINTBEGIN(readability-identifier-naming) FlutterStandardDataTypeUInt8, FlutterStandardDataTypeInt32, FlutterStandardDataTypeInt64, FlutterStandardDataTypeFloat32, FlutterStandardDataTypeFloat64, + // NOLINTEND(readability-identifier-naming) }; /** diff --git a/shell/platform/darwin/common/framework/Source/FlutterStandardCodecHelper.h b/shell/platform/darwin/common/framework/Source/FlutterStandardCodecHelper.h index 62faa46816b88..94c843a256f8e 100644 --- a/shell/platform/darwin/common/framework/Source/FlutterStandardCodecHelper.h +++ b/shell/platform/darwin/common/framework/Source/FlutterStandardCodecHelper.h @@ -13,8 +13,11 @@ extern "C" { #endif +// NOLINTBEGIN(google-runtime-int) + // Note: Update FlutterStandardFieldIsStandardType if this changes. typedef enum { + // NOLINTBEGIN(readability-identifier-naming) FlutterStandardFieldNil, FlutterStandardFieldTrue, FlutterStandardFieldFalse, @@ -30,6 +33,7 @@ typedef enum { FlutterStandardFieldList, FlutterStandardFieldMap, FlutterStandardFieldFloat32Data, + // NOLINTEND(readability-identifier-naming) } FlutterStandardField; static inline bool FlutterStandardFieldIsStandardType(uint8_t field) { @@ -38,6 +42,7 @@ static inline bool FlutterStandardFieldIsStandardType(uint8_t field) { } typedef enum { + // NOLINTBEGIN(readability-identifier-naming) FlutterStandardCodecObjcTypeNil, FlutterStandardCodecObjcTypeNSNumber, FlutterStandardCodecObjcTypeNSString, @@ -46,6 +51,7 @@ typedef enum { FlutterStandardCodecObjcTypeNSArray, FlutterStandardCodecObjcTypeNSDictionary, FlutterStandardCodecObjcTypeUnknown, + // NOLINTEND(readability-identifier-naming) } FlutterStandardCodecObjcType; /////////////////////////////////////////////////////////////////////////////// @@ -105,6 +111,8 @@ bool FlutterStandardCodecHelperWriteNumber(CFMutableDataRef data, ///@} +// NOLINTEND(google-runtime-int) + #if defined(__cplusplus) } #endif diff --git a/shell/platform/embedder/embedder.h b/shell/platform/embedder/embedder.h index 1d9bb0a98f340..6ac644181f8e6 100644 --- a/shell/platform/embedder/embedder.h +++ b/shell/platform/embedder/embedder.h @@ -2263,6 +2263,8 @@ typedef struct { #ifndef FLUTTER_ENGINE_NO_PROTOTYPES +// NOLINTBEGIN(google-objc-function-naming) + //------------------------------------------------------------------------------ /// @brief Creates the necessary data structures to launch a Flutter Dart /// application in AOT mode. The data may only be collected after @@ -3134,6 +3136,8 @@ FLUTTER_EXPORT FlutterEngineResult FlutterEngineGetProcAddresses( FlutterEngineProcTable* table); +// NOLINTEND(google-objc-function-naming) + #if defined(__cplusplus) } // extern "C" #endif diff --git a/shell/platform/embedder/tests/embedder_assertions.h b/shell/platform/embedder/tests/embedder_assertions.h index dc639eba2556c..09b0d48bd0830 100644 --- a/shell/platform/embedder/tests/embedder_assertions.h +++ b/shell/platform/embedder/tests/embedder_assertions.h @@ -15,6 +15,8 @@ #include "third_party/skia/include/core/SkPoint.h" #include "third_party/skia/include/core/SkSize.h" +// NOLINTBEGIN(google-objc-function-naming) + //------------------------------------------------------------------------------ // Equality //------------------------------------------------------------------------------ @@ -576,4 +578,6 @@ inline FlutterRoundedRect FlutterRoundedRectMake(const SkRRect& rect) { return r; } +// NOLINTEND(google-objc-function-naming) + #endif // FLUTTER_SHELL_PLATFORM_EMBEDDER_TESTS_EMBEDDER_ASSERTIONS_H_ diff --git a/shell/platform/embedder/tests/embedder_unittests_util.h b/shell/platform/embedder/tests/embedder_unittests_util.h index cbc189269008c..4e1cae51b1df7 100644 --- a/shell/platform/embedder/tests/embedder_unittests_util.h +++ b/shell/platform/embedder/tests/embedder_unittests_util.h @@ -8,6 +8,7 @@ #define FML_USED_ON_EMBEDDER #include +#include #include "flutter/fml/mapping.h" #include "flutter/fml/message_loop.h" @@ -104,8 +105,8 @@ class EmbedderTestTaskRunner { EmbedderTestTaskRunner(fml::RefPtr real_task_runner, TaskExpiryCallback on_task_expired) : identifier_(++sEmbedderTaskRunnerIdentifiers), - real_task_runner_(real_task_runner), - on_task_expired_(on_task_expired) { + real_task_runner_(std::move(real_task_runner)), + on_task_expired_(std::move(on_task_expired)) { FML_CHECK(real_task_runner_); FML_CHECK(on_task_expired_);