Skip to content

Commit 0cc9f78

Browse files
committed
Add a format checker to the CI pipeline (#90)
* Format gn files * Format C/C++ files * Update azure-pipelines.yml * Rename the format job
1 parent 3cadd3a commit 0cc9f78

31 files changed

+217
-117
lines changed

azure-pipelines.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,17 @@ pr:
88
- flutter-*-tizen
99

1010
jobs:
11+
- job: format
12+
pool:
13+
name: Default
14+
demands: agent.os -equals Linux
15+
steps:
16+
- checkout: self
17+
path: src/flutter
18+
- bash: ci/format.sh
19+
displayName: Verify formatting
1120
- job: build
21+
dependsOn: format
1222
strategy:
1323
matrix:
1424
tizen-arm-release:

shell/platform/common/BUILD.gn

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ source_set("common_cpp") {
111111
deps = [
112112
":common_cpp_library_headers",
113113
"//flutter/shell/platform/common/client_wrapper:client_wrapper",
114-
# "//flutter/shell/platform/embedder:embedder_as_internal_library",
115114
]
116115

117116
public_deps = [

shell/platform/embedder/BUILD.gn

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,8 @@ shared_library("flutter_engine_library") {
281281
output_name = "flutter_engine"
282282

283283
# For Tizen 5.5 or older. See the script file for details.
284-
ldflags = [ "-Wl,--version-script=" + rebase_path("flutter_engine_exports.lst") ]
284+
ldflags =
285+
[ "-Wl,--version-script=" + rebase_path("flutter_engine_exports.lst") ]
285286

286287
if (is_mac && !embedder_for_target) {
287288
ldflags = [ "-Wl,-install_name,@rpath/FlutterEmbedder.framework/$_framework_binary_subpath" ]

shell/platform/tizen/BUILD.gn

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ template("embedder_for_profile") {
9696
"channels/settings_channel.cc",
9797
"channels/text_input_channel.cc",
9898
"external_texture_gl.cc",
99-
"flutter_tizen_engine.cc",
10099
"flutter_tizen.cc",
100+
"flutter_tizen_engine.cc",
101101
"key_event_handler.cc",
102102
"tizen_event_loop.cc",
103103
"tizen_log.cc",
@@ -152,7 +152,7 @@ template("embedder_for_profile") {
152152

153153
configs += [
154154
":tizen_rootstrap_include_dirs",
155-
"//flutter/shell/platform/common/cpp:desktop_library_implementation"
155+
"//flutter/shell/platform/common/cpp:desktop_library_implementation",
156156
]
157157

158158
public_configs = [ "//flutter:config" ]
@@ -214,12 +214,12 @@ copy("copy_icu") {
214214

215215
group("tizen") {
216216
deps = [
217+
":copy_icu",
218+
":flutter_tizen_common",
217219
":flutter_tizen_mobile",
218-
":flutter_tizen_wearable",
219220
":flutter_tizen_tv",
220-
":flutter_tizen_common",
221+
":flutter_tizen_wearable",
221222
":publish_cpp_client_wrapper",
222223
":publish_headers_tizen",
223-
":copy_icu",
224224
]
225225
}

shell/platform/tizen/channels/key_event_channel.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@ static const std::map<int, int> kModifierMap = {
215215
KeyEventChannel::KeyEventChannel(flutter::BinaryMessenger* messenger)
216216
: channel_(
217217
std::make_unique<flutter::BasicMessageChannel<rapidjson::Document>>(
218-
messenger, kChannelName,
218+
messenger,
219+
kChannelName,
219220
&flutter::JsonMessageCodec::GetInstance())) {}
220221

221222
KeyEventChannel::~KeyEventChannel() {}

shell/platform/tizen/channels/navigation_channel.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ static constexpr char kPopRouteMethod[] = "popRoute";
1414

1515
NavigationChannel::NavigationChannel(flutter::BinaryMessenger* messenger)
1616
: channel_(std::make_unique<flutter::MethodChannel<rapidjson::Document>>(
17-
messenger, kChannelName, &flutter::JsonMethodCodec::GetInstance())) {}
17+
messenger,
18+
kChannelName,
19+
&flutter::JsonMethodCodec::GetInstance())) {}
1820

1921
NavigationChannel::~NavigationChannel() {}
2022

shell/platform/tizen/channels/platform_channel.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ static constexpr char kChannelName[] = "flutter/platform";
1717
PlatformChannel::PlatformChannel(flutter::BinaryMessenger* messenger,
1818
TizenRenderer* renderer)
1919
: channel_(std::make_unique<flutter::MethodChannel<rapidjson::Document>>(
20-
messenger, kChannelName, &flutter::JsonMethodCodec::GetInstance())),
20+
messenger,
21+
kChannelName,
22+
&flutter::JsonMethodCodec::GetInstance())),
2123
renderer_(renderer) {
2224
channel_->SetMethodCallHandler(
2325
[this](
@@ -327,8 +329,7 @@ void GetData(
327329
document.SetObject();
328330
rapidjson::Document::AllocatorType& allocator = document.GetAllocator();
329331
document.AddMember(rapidjson::Value(kTextKey, allocator),
330-
rapidjson::Value(string_clipboard, allocator),
331-
allocator);
332+
rapidjson::Value(string_clipboard, allocator), allocator);
332333
result->Success(document);
333334
}
334335

shell/platform/tizen/channels/platform_channel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ void GetData(
3535
void SetData(
3636
const flutter::MethodCall<rapidjson::Document>& call,
3737
std::unique_ptr<flutter::MethodResult<rapidjson::Document>> result);
38-
};
38+
}; // namespace Clipboard
3939

4040
#endif // EMBEDDER_PLATFORM_CHANNEL_H_

shell/platform/tizen/channels/platform_view_channel.cc

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ int ExtractIntFromMap(const flutter::EncodableValue& arguments,
3030
if (std::holds_alternative<flutter::EncodableMap>(arguments)) {
3131
flutter::EncodableMap values = std::get<flutter::EncodableMap>(arguments);
3232
flutter::EncodableValue value = values[flutter::EncodableValue(key)];
33-
if (std::holds_alternative<int>(value)) return std::get<int>(value);
33+
if (std::holds_alternative<int>(value))
34+
return std::get<int>(value);
3435
}
3536
return -1;
3637
}
@@ -40,13 +41,15 @@ double ExtractDoubleFromMap(const flutter::EncodableValue& arguments,
4041
if (std::holds_alternative<flutter::EncodableMap>(arguments)) {
4142
flutter::EncodableMap values = std::get<flutter::EncodableMap>(arguments);
4243
flutter::EncodableValue value = values[flutter::EncodableValue(key)];
43-
if (std::holds_alternative<double>(value)) return std::get<double>(value);
44+
if (std::holds_alternative<double>(value))
45+
return std::get<double>(value);
4446
}
4547
return -1;
4648
}
4749

4850
flutter::EncodableMap ExtractMapFromMap(
49-
const flutter::EncodableValue& arguments, const char* key) {
51+
const flutter::EncodableValue& arguments,
52+
const char* key) {
5053
if (std::holds_alternative<flutter::EncodableMap>(arguments)) {
5154
flutter::EncodableMap values = std::get<flutter::EncodableMap>(arguments);
5255
flutter::EncodableValue value = values[flutter::EncodableValue(key)];
@@ -57,7 +60,8 @@ flutter::EncodableMap ExtractMapFromMap(
5760
}
5861

5962
flutter::EncodableList ExtractListFromMap(
60-
const flutter::EncodableValue& arguments, const char* key) {
63+
const flutter::EncodableValue& arguments,
64+
const char* key) {
6165
if (std::holds_alternative<flutter::EncodableMap>(arguments)) {
6266
flutter::EncodableMap values = std::get<flutter::EncodableMap>(arguments);
6367
flutter::EncodableValue value = values[flutter::EncodableValue(key)];
@@ -72,15 +76,18 @@ PlatformViewChannel::PlatformViewChannel(flutter::BinaryMessenger* messenger,
7276
: engine_(engine),
7377
channel_(
7478
std::make_unique<flutter::MethodChannel<flutter::EncodableValue>>(
75-
messenger, kChannelName,
79+
messenger,
80+
kChannelName,
7681
&flutter::StandardMethodCodec::GetInstance())) {
7782
channel_->SetMethodCallHandler(
7883
[this](const flutter::MethodCall<flutter::EncodableValue>& call,
7984
std::unique_ptr<flutter::MethodResult<flutter::EncodableValue>>
8085
result) { HandleMethodCall(call, std::move(result)); });
8186
}
8287

83-
PlatformViewChannel::~PlatformViewChannel() { Dispose(); }
88+
PlatformViewChannel::~PlatformViewChannel() {
89+
Dispose();
90+
}
8491

8592
void PlatformViewChannel::Dispose() {
8693
// Clean-up view_instances_

shell/platform/tizen/channels/settings_channel.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ static constexpr char kPlatformBrightnessKey[] = "platformBrightness";
1212
SettingsChannel::SettingsChannel(flutter::BinaryMessenger* messenger)
1313
: channel_(
1414
std::make_unique<flutter::BasicMessageChannel<rapidjson::Document>>(
15-
messenger, kChannelName,
15+
messenger,
16+
kChannelName,
1617
&flutter::JsonMessageCodec::GetInstance())) {
1718
system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR,
1819
OnSettingsChangedCallback, this);

shell/platform/tizen/channels/text_input_channel.cc

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ static const char* GetImfMethod() {
4141
Eina_List* modules;
4242

4343
modules = ecore_imf_context_available_ids_get();
44-
if (!modules) return nullptr;
44+
if (!modules)
45+
return nullptr;
4546

4647
void* module;
4748
EINA_LIST_FREE(modules, module) { return (const char*)module; }
@@ -56,7 +57,8 @@ static bool IsASCIIPrintableKey(char c) {
5657
return false;
5758
}
5859

59-
void TextInputChannel::CommitCallback(void* data, Ecore_IMF_Context* ctx,
60+
void TextInputChannel::CommitCallback(void* data,
61+
Ecore_IMF_Context* ctx,
6062
void* event_info) {
6163
TextInputChannel* self = (TextInputChannel*)data;
6264
if (!self) {
@@ -72,7 +74,8 @@ void TextInputChannel::CommitCallback(void* data, Ecore_IMF_Context* ctx,
7274
self->OnCommit(str);
7375
}
7476

75-
void TextInputChannel::PreeditCallback(void* data, Ecore_IMF_Context* ctx,
77+
void TextInputChannel::PreeditCallback(void* data,
78+
Ecore_IMF_Context* ctx,
7679
void* event_info) {
7780
TextInputChannel* self = (TextInputChannel*)data;
7881
if (!self) {
@@ -108,7 +111,9 @@ void TextInputChannel::DeleteSurroundingCallback(void* data,
108111
}
109112

110113
void TextInputChannel::InputPanelStateChangedCallback(
111-
void* data, Ecore_IMF_Context* context, int value) {
114+
void* data,
115+
Ecore_IMF_Context* context,
116+
int value) {
112117
FT_LOGD("Change input panel state[%d]", value);
113118
if (!data) {
114119
FT_LOGW("No Data");
@@ -130,7 +135,9 @@ void TextInputChannel::InputPanelStateChangedCallback(
130135
}
131136

132137
void TextInputChannel::InputPanelGeometryChangedCallback(
133-
void* data, Ecore_IMF_Context* context, int value) {
138+
void* data,
139+
Ecore_IMF_Context* context,
140+
int value) {
134141
if (!data) {
135142
FT_LOGW("No Data");
136143
return;
@@ -205,7 +212,9 @@ Ecore_IMF_Keyboard_Locks EcoreInputModifierToEcoreIMFLock(
205212
TextInputChannel::TextInputChannel(flutter::BinaryMessenger* messenger,
206213
FlutterTizenEngine* engine)
207214
: channel_(std::make_unique<flutter::MethodChannel<rapidjson::Document>>(
208-
messenger, kChannelName, &flutter::JsonMethodCodec::GetInstance())),
215+
messenger,
216+
kChannelName,
217+
&flutter::JsonMethodCodec::GetInstance())),
209218
engine_(engine) {
210219
channel_->SetMethodCallHandler(
211220
[this](
@@ -367,7 +376,7 @@ bool TextInputChannel::FilterEvent(Ecore_Event_Key* keyDownEvent) {
367376
bool isIME = true;
368377
#else
369378
bool isIME = ecore_imf_context_keyboard_mode_get(imf_context_) ==
370-
ECORE_IMF_INPUT_PANEL_SW_KEYBOARD_MODE;
379+
ECORE_IMF_INPUT_PANEL_SW_KEYBOARD_MODE;
371380
#endif
372381

373382
Ecore_IMF_Event_Key_Down ecoreKeyDownEvent;

shell/platform/tizen/channels/text_input_channel.h

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,17 @@ class TextInputChannel {
6464
std::unique_ptr<flutter::MethodChannel<rapidjson::Document>> channel_;
6565
std::unique_ptr<flutter::TextInputModel> active_model_;
6666

67-
static void CommitCallback(void* data, Ecore_IMF_Context* ctx,
67+
static void CommitCallback(void* data,
68+
Ecore_IMF_Context* ctx,
6869
void* event_info);
69-
static void PreeditCallback(void* data, Ecore_IMF_Context* ctx,
70+
static void PreeditCallback(void* data,
71+
Ecore_IMF_Context* ctx,
7072
void* event_info);
71-
static void PrivateCommandCallback(void* data, Ecore_IMF_Context* ctx,
73+
static void PrivateCommandCallback(void* data,
74+
Ecore_IMF_Context* ctx,
7275
void* event_info);
73-
static void DeleteSurroundingCallback(void* data, Ecore_IMF_Context* ctx,
76+
static void DeleteSurroundingCallback(void* data,
77+
Ecore_IMF_Context* ctx,
7478
void* event_info);
7579
static void InputPanelStateChangedCallback(void* data,
7680
Ecore_IMF_Context* context,
@@ -80,7 +84,8 @@ class TextInputChannel {
8084
int value);
8185
static Eina_Bool RetrieveSurroundingCallback(void* data,
8286
Ecore_IMF_Context* ctx,
83-
char** text, int* cursor_pos);
87+
char** text,
88+
int* cursor_pos);
8489

8590
int client_id_{0};
8691
SoftwareKeyboardGeometry current_keyboard_geometry_;

shell/platform/tizen/external_texture_gl.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ bool ExternalTextureGL::OnFrameAvailable(tbm_surface_h tbm_surface) {
9393
}
9494

9595
bool ExternalTextureGL::PopulateTextureWithIdentifier(
96-
size_t width, size_t height, FlutterOpenGLTexture* opengl_texture) {
96+
size_t width,
97+
size_t height,
98+
FlutterOpenGLTexture* opengl_texture) {
9799
if (!available_tbm_surface_) {
98100
FT_LOGD("[texture id:%ld] available_tbm_surface_ is null", texture_id_);
99101
return false;

shell/platform/tizen/external_texture_gl.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ class ExternalTextureGL {
3838
* texture object.
3939
* Returns true on success, false on failure.
4040
*/
41-
bool PopulateTextureWithIdentifier(size_t width, size_t height,
41+
bool PopulateTextureWithIdentifier(size_t width,
42+
size_t height,
4243
FlutterOpenGLTexture* opengl_texture);
4344
bool OnFrameAvailable(tbm_surface_h tbm_surface);
4445

0 commit comments

Comments
 (0)