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

Commit 7cf9d90

Browse files
authored
Yet more compliance with .clang_tidy, stragglers edition. (#48291)
Based off the [failures](https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8763786250936903249/+/u/test:_test:_lint_host_debug/stdout) in #48145. Nothing particularly interesting.
1 parent a8e9b8d commit 7cf9d90

File tree

13 files changed

+50
-24
lines changed

13 files changed

+50
-24
lines changed

impeller/renderer/testing/mocks.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class MockRenderPass : public RenderPass {
105105
class MockCommandBuffer : public CommandBuffer {
106106
public:
107107
explicit MockCommandBuffer(std::weak_ptr<const Context> context)
108-
: CommandBuffer(context) {}
108+
: CommandBuffer(std::move(context)) {}
109109
MOCK_METHOD(bool, IsValid, (), (const, override));
110110
MOCK_METHOD(void, SetLabel, (const std::string& label), (const, override));
111111
MOCK_METHOD(std::shared_ptr<BlitPass>, OnCreateBlitPass, (), (override));

shell/platform/linux/fl_engine_private.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ G_BEGIN_DECLS
2121
*/
2222

2323
typedef enum {
24+
// NOLINTBEGIN(readability-identifier-naming)
2425
FL_ENGINE_ERROR_FAILED,
26+
// NOLINTEND(readability-identifier-naming)
2527
} FlEngineError;
2628

2729
GQuark fl_engine_error_quark(void) G_GNUC_CONST;

shell/platform/linux/fl_renderer.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ G_BEGIN_DECLS
2020
*/
2121

2222
typedef enum {
23+
// NOLINTBEGIN(readability-identifier-naming)
2324
FL_RENDERER_ERROR_FAILED,
25+
// NOLINTEND(readability-identifier-naming)
2426
} FlRendererError;
2527

2628
GQuark fl_renderer_error_quark(void) G_GNUC_CONST;

shell/platform/linux/fl_settings.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ G_DECLARE_INTERFACE(FlSettings, fl_settings, FL, SETTINGS, GObject)
1919
* Available clock formats.
2020
*/
2121
typedef enum {
22+
// NOLINTBEGIN(readability-identifier-naming)
2223
FL_CLOCK_FORMAT_12H,
2324
FL_CLOCK_FORMAT_24H,
25+
// NOLINTEND(readability-identifier-naming)
2426
} FlClockFormat;
2527

2628
/**
@@ -31,8 +33,10 @@ typedef enum {
3133
* Available color schemes.
3234
*/
3335
typedef enum {
36+
// NOLINTBEGIN(readability-identifier-naming)
3437
FL_COLOR_SCHEME_LIGHT,
3538
FL_COLOR_SCHEME_DARK,
39+
// NOLINTEND(readability-identifier-naming)
3640
} FlColorScheme;
3741

3842
/**

shell/platform/linux/public/flutter_linux/fl_json_message_codec.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@ G_BEGIN_DECLS
2727
#define FL_JSON_MESSAGE_CODEC_ERROR fl_json_message_codec_error_quark()
2828

2929
typedef enum {
30+
// NOLINTBEGIN(readability-identifier-naming)
3031
FL_JSON_MESSAGE_CODEC_ERROR_INVALID_UTF8,
3132
FL_JSON_MESSAGE_CODEC_ERROR_INVALID_JSON,
3233
FL_JSON_MESSAGE_CODEC_ERROR_INVALID_OBJECT_KEY_TYPE,
34+
// NOLINTEND(readability-identifier-naming)
3335
} FlJsonMessageCodecError;
3436

3537
GQuark fl_json_message_codec_error_quark(void) G_GNUC_CONST;

shell/platform/linux/public/flutter_linux/fl_message_codec.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,12 @@ G_BEGIN_DECLS
3030
#define FL_MESSAGE_CODEC_ERROR fl_message_codec_error_quark()
3131

3232
typedef enum {
33+
// NOLINTBEGIN(readability-identifier-naming)
3334
FL_MESSAGE_CODEC_ERROR_FAILED,
3435
FL_MESSAGE_CODEC_ERROR_OUT_OF_DATA,
3536
FL_MESSAGE_CODEC_ERROR_ADDITIONAL_DATA,
3637
FL_MESSAGE_CODEC_ERROR_UNSUPPORTED_TYPE,
38+
// NOLINTEND(readability-identifier-naming)
3739
} FlMessageCodecError;
3840

3941
GQuark fl_message_codec_error_quark(void) G_GNUC_CONST;

shell/platform/linux/public/flutter_linux/fl_method_response.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@ G_BEGIN_DECLS
3030
#define FL_METHOD_RESPONSE_ERROR fl_method_response_error_quark()
3131

3232
typedef enum {
33+
// NOLINTBEGIN(readability-identifier-naming)
3334
FL_METHOD_RESPONSE_ERROR_FAILED,
3435
FL_METHOD_RESPONSE_ERROR_REMOTE_ERROR,
3536
FL_METHOD_RESPONSE_ERROR_NOT_IMPLEMENTED,
37+
// NOLINTEND(readability-identifier-naming)
3638
} FlMethodResponseError;
3739

3840
GQuark fl_method_response_error_quark(void) G_GNUC_CONST;

shell/platform/linux/testing/mock_binary_messenger.cc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,26 +40,26 @@ MockBinaryMessenger::operator FlBinaryMessenger*() {
4040
}
4141

4242
bool MockBinaryMessenger::HasMessageHandler(const gchar* channel) const {
43-
return message_handlers.at(channel) != nullptr;
43+
return message_handlers_.at(channel) != nullptr;
4444
}
4545

4646
void MockBinaryMessenger::SetMessageHandler(
4747
const gchar* channel,
4848
FlBinaryMessengerMessageHandler handler,
4949
gpointer user_data) {
50-
message_handlers[channel] = handler;
51-
user_datas[channel] = user_data;
50+
message_handlers_[channel] = handler;
51+
user_datas_[channel] = user_data;
5252
}
5353

5454
void MockBinaryMessenger::ReceiveMessage(const gchar* channel,
5555
GBytes* message) {
56-
FlBinaryMessengerMessageHandler handler = message_handlers[channel];
57-
if (response_handles[channel] == nullptr) {
58-
response_handles[channel] = FL_BINARY_MESSENGER_RESPONSE_HANDLE(
56+
FlBinaryMessengerMessageHandler handler = message_handlers_[channel];
57+
if (response_handles_[channel] == nullptr) {
58+
response_handles_[channel] = FL_BINARY_MESSENGER_RESPONSE_HANDLE(
5959
fl_mock_binary_messenger_response_handle_new());
6060
}
61-
handler(instance_, channel, message, response_handles[channel],
62-
user_datas[channel]);
61+
handler(instance_, channel, message, response_handles_[channel],
62+
user_datas_[channel]);
6363
}
6464

6565
static void fl_mock_binary_messenger_iface_init(

shell/platform/linux/testing/mock_binary_messenger.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ class MockBinaryMessenger {
2020
MockBinaryMessenger();
2121
~MockBinaryMessenger();
2222

23+
// This was an existing use of operator overloading. It's against our style
24+
// guide but enabling clang tidy on header files is a higher priority than
25+
// fixing this.
26+
// NOLINTNEXTLINE(google-explicit-constructor)
2327
operator FlBinaryMessenger*();
2428

2529
MOCK_METHOD(void,
@@ -75,10 +79,10 @@ class MockBinaryMessenger {
7579
private:
7680
FlBinaryMessenger* instance_ = nullptr;
7781
std::unordered_map<std::string, FlBinaryMessengerMessageHandler>
78-
message_handlers;
82+
message_handlers_;
7983
std::unordered_map<std::string, FlBinaryMessengerResponseHandle*>
80-
response_handles;
81-
std::unordered_map<std::string, gpointer> user_datas;
84+
response_handles_;
85+
std::unordered_map<std::string, gpointer> user_datas_;
8286
};
8387

8488
} // namespace testing

shell/platform/linux/testing/mock_im_context.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ class MockIMContext {
1616
public:
1717
~MockIMContext();
1818

19+
// This was an existing use of operator overloading. It's against our style
20+
// guide but enabling clang tidy on header files is a higher priority than
21+
// fixing this.
22+
// NOLINTNEXTLINE(google-explicit-constructor)
1923
operator GtkIMContext*();
2024

2125
MOCK_METHOD(void,

0 commit comments

Comments
 (0)