Skip to content

Commit f5af41a

Browse files
committed
Stop breaking long strings
1 parent ff5cb60 commit f5af41a

File tree

33 files changed

+340
-382
lines changed

33 files changed

+340
-382
lines changed

.clang-format

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ BinPackArguments: false
1010
BinPackParameters: false
1111
BreakBeforeBraces: Attach
1212
BreakAfterAttributes: Always
13+
BreakStringLiterals: false
1314
ColumnLimit: 80
1415
IncludeBlocks: Merge
1516
IncludeCategories:

modules/fleet-provisioning/src/cloud_request.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,9 @@ static GglError send_csr_request(
7575
}
7676

7777
if (ggl_obj_type(*token_val) != GGL_TYPE_BUF) {
78-
GGL_LOGE("Failed to register certificate. Reason: Invalid "
79-
"certificateOwnershipToken.");
78+
GGL_LOGE(
79+
"Failed to register certificate. Reason: Invalid certificateOwnershipToken."
80+
);
8081
return GGL_ERR_INVALID;
8182
}
8283

modules/fleet-provisioning/src/config_operations.c

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ GglError ggl_load_template_params(
8080
&result
8181
);
8282
if (ret != GGL_ERR_OK) {
83-
GGL_LOGE("Failed to read "
84-
"services/aws.greengrass.fleet_provisioning/configuration/"
85-
"templateParams");
83+
GGL_LOGE(
84+
"Failed to read services/aws.greengrass.fleet_provisioning/configuration/templateParams"
85+
);
8686
return ret;
8787
}
8888
}
@@ -115,9 +115,9 @@ static GglError load_csr_common_name(FleetProvArgs *args) {
115115
}
116116

117117
if (ret != GGL_ERR_OK) {
118-
GGL_LOGE("Failed to read "
119-
"services/aws.greengrass.fleet_provisioning/configuration/"
120-
"csrCommonName");
118+
GGL_LOGE(
119+
"Failed to read services/aws.greengrass.fleet_provisioning/configuration/csrCommonName"
120+
);
121121
}
122122

123123
return ret;
@@ -232,9 +232,9 @@ GglError ggl_get_configuration(FleetProvArgs *args) {
232232
&args->claim_cert
233233
);
234234
if (ret != GGL_ERR_OK) {
235-
GGL_LOGE("Failed to read "
236-
"services/aws.greengrass.fleet_provisioning/configuration/"
237-
"claimCertPath");
235+
GGL_LOGE(
236+
"Failed to read services/aws.greengrass.fleet_provisioning/configuration/claimCertPath"
237+
);
238238
return ret;
239239
}
240240
}
@@ -247,9 +247,9 @@ GglError ggl_get_configuration(FleetProvArgs *args) {
247247
&args->claim_key
248248
);
249249
if (ret != GGL_ERR_OK) {
250-
GGL_LOGE("Failed to read "
251-
"services/aws.greengrass.fleet_provisioning/configuration/"
252-
"claimKeyPath");
250+
GGL_LOGE(
251+
"Failed to read services/aws.greengrass.fleet_provisioning/configuration/claimKeyPath"
252+
);
253253
return ret;
254254
}
255255
}
@@ -262,9 +262,9 @@ GglError ggl_get_configuration(FleetProvArgs *args) {
262262
&args->root_ca_path
263263
);
264264
if (ret != GGL_ERR_OK) {
265-
GGL_LOGE("Failed to read "
266-
"services/aws.greengrass.fleet_provisioning/configuration/"
267-
"rootCaPath");
265+
GGL_LOGE(
266+
"Failed to read services/aws.greengrass.fleet_provisioning/configuration/rootCaPath"
267+
);
268268
return ret;
269269
}
270270
}
@@ -277,9 +277,9 @@ GglError ggl_get_configuration(FleetProvArgs *args) {
277277
&args->template_name
278278
);
279279
if (ret != GGL_ERR_OK) {
280-
GGL_LOGE("Failed to read "
281-
"services/aws.greengrass.fleet_provisioning/configuration/"
282-
"templateName");
280+
GGL_LOGE(
281+
"Failed to read services/aws.greengrass.fleet_provisioning/configuration/templateName"
282+
);
283283
return ret;
284284
}
285285
}
@@ -292,9 +292,9 @@ GglError ggl_get_configuration(FleetProvArgs *args) {
292292
&args->endpoint
293293
);
294294
if (ret != GGL_ERR_OK) {
295-
GGL_LOGW("Failed to read "
296-
"services/aws.greengrass.fleet_provisioning/configuration/"
297-
"iotDataEndpoint");
295+
GGL_LOGW(
296+
"Failed to read services/aws.greengrass.fleet_provisioning/configuration/iotDataEndpoint"
297+
);
298298
return ret;
299299
}
300300
}

modules/gg-fleet-statusd/src/entry.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,9 @@ static uint64_t get_periodic_status_interval(void) {
179179
)) {
180180
interval_seconds = parsed_value;
181181
} else {
182-
GGL_LOGD("Invalid value. Using default periodic status "
183-
"interval: 86400 seconds");
182+
GGL_LOGD(
183+
"Invalid value. Using default periodic status interval: 86400 seconds"
184+
);
184185
return 86400; // Default 24 hours
185186
}
186187
}

modules/gg-fleet-statusd/src/fleet_status_service.c

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,10 @@ GglError publish_fleet_status_update(
6060

6161
bool device_healthy = true;
6262

63-
GglBuffer component_info_mem = GGL_BUF((uint8_t[PAYLOAD_BUFFER_LEN - 128]
64-
) { 0 }); // The size of the payload buffer minus some bytes we will need
65-
// for boilerplate contents, is the max we can send
63+
// The size of the payload buffer minus some bytes we will need for
64+
// boilerplate contents, is the max we can send
65+
GglBuffer component_info_mem
66+
= GGL_BUF((uint8_t[PAYLOAD_BUFFER_LEN - 128]) { 0 });
6667
GglArena alloc = ggl_arena_init(component_info_mem);
6768

6869
// retrieve running components from services config
@@ -86,8 +87,7 @@ GglError publish_fleet_status_update(
8687
GGL_LIST_FOREACH (component_obj, components) {
8788
if (ggl_obj_type(*component_obj) != GGL_TYPE_BUF) {
8889
GGL_LOGE(
89-
"Incorrect type of component key received. Expected buffer. "
90-
"Cannot publish fleet status update for this entry."
90+
"Incorrect type of component key received. Expected buffer. Cannot publish fleet status update for this entry."
9191
);
9292
continue;
9393
}
@@ -124,9 +124,7 @@ GglError publish_fleet_status_update(
124124
);
125125
if (ret != GGL_ERR_OK) {
126126
GGL_LOGE(
127-
"Unable to retrieve version of %.*s with error %s. Cannot "
128-
"publish fleet "
129-
"status update for this component.",
127+
"Unable to retrieve version of %.*s with error %s. Cannot publish fleet status update for this component.",
130128
(int) component.len,
131129
component.data,
132130
ggl_strerror(ret)
@@ -142,8 +140,7 @@ GglError publish_fleet_status_update(
142140
);
143141
if (ret != GGL_ERR_OK) {
144142
GGL_LOGE(
145-
"Failed to retrieve health status for %.*s with error %s. "
146-
"Cannot publish fleet status update for this component.",
143+
"Failed to retrieve health status for %.*s with error %s. Cannot publish fleet status update for this component.",
147144
(int) component.len,
148145
component.data,
149146
ggl_strerror(ret)
@@ -165,10 +162,7 @@ GglError publish_fleet_status_update(
165162
);
166163
if (ret != GGL_ERR_OK) {
167164
GGL_LOGE(
168-
"Unable to retrieve fleet configuration arn list for component "
169-
"%.*s from "
170-
"config with error %s. Cannot publish fleet status update for "
171-
"this component.",
165+
"Unable to retrieve fleet configuration arn list for component %.*s from config with error %s. Cannot publish fleet status update for this component.",
172166
(int) component.len,
173167
component.data,
174168
ggl_strerror(ret)
@@ -177,9 +171,7 @@ GglError publish_fleet_status_update(
177171
}
178172
if (ggl_obj_type(arn_list) != GGL_TYPE_LIST) {
179173
GGL_LOGE(
180-
"Fleet configuration arn retrieved from config not of "
181-
"type list for component %.*s. Cannot publish fleet "
182-
"status update for this component.",
174+
"Fleet configuration arn retrieved from config not of type list for component %.*s. Cannot publish fleet status update for this component.",
183175
(int) component.len,
184176
component.data
185177
);
@@ -209,9 +201,7 @@ GglError publish_fleet_status_update(
209201
);
210202
if (ret != GGL_ERR_OK) {
211203
GGL_LOGE(
212-
"Failed to add component info for %.*s to component list with "
213-
"error %s. Cannot publish fleet status update for this "
214-
"component.",
204+
"Failed to add component info for %.*s to component list with error %s. Cannot publish fleet status update for this component.",
215205
(int) component.len,
216206
component.data,
217207
ggl_strerror(ret)

modules/ggconfigd/src/db_corebus.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ static GglError decode_object_destructive(GglObject *obj, GglArena *arena) {
3939
= decode_object_destructive(ggl_kv_val(kv), arena);
4040
if (decode_err != GGL_ERR_OK) {
4141
GGL_LOGE(
42-
"decode map value at index %d and key %.*s failed with "
43-
"error code: %d",
42+
"decode map value at index %d and key %.*s failed with error code: %d",
4443
(int) (kv - map.pairs),
4544
(int) ggl_kv_key(*kv).len,
4645
ggl_kv_key(*kv).data,

modules/ggconfigd/src/db_interface.c

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,7 @@ GglError ggconfig_open(void) {
105105
);
106106
if (rc) {
107107
GGL_LOGI(
108-
"Failed to add an index to the relationTable %s, "
109-
"expect an "
110-
"autoindex to be created",
108+
"Failed to add an index to the relationTable %s, expect an autoindex to be created",
111109
err_message
112110
);
113111
sqlite3_free(err_message);
@@ -537,8 +535,8 @@ static GglError create_key_path(GglList *key_path, GglObjVec *key_ids_output) {
537535
err = value_is_present_for_key(current_key_id, &value_is_present);
538536
if (err != GGL_ERR_OK) {
539537
GGL_LOGE(
540-
"failed to check for value for key %d (%.*s) in key path "
541-
"%s with id %" PRId64 " with error %s",
538+
"failed to check for value for key %d (%.*s) in key path %s with id %" PRId64
539+
" with error %s",
542540
(int) index,
543541
(int) current_key_buffer.len,
544542
current_key_buffer.data,
@@ -550,8 +548,8 @@ static GglError create_key_path(GglList *key_path, GglObjVec *key_ids_output) {
550548
}
551549
if (value_is_present) {
552550
GGL_LOGW(
553-
"value already present for key %d (%.*s) in key path %s "
554-
"with id %" PRId64 ". Failing request.",
551+
"value already present for key %d (%.*s) in key path %s with id %" PRId64
552+
". Failing request.",
555553
(int) index,
556554
(int) current_key_buffer.len,
557555
current_key_buffer.data,
@@ -633,8 +631,8 @@ static GglError notify_single_key(
633631
} break;
634632
default:
635633
GGL_LOGE(
636-
"Unexpected rc %d while getting handles to notify for key with "
637-
"id %" PRId64 " with error: %s",
634+
"Unexpected rc %d while getting handles to notify for key with id %" PRId64
635+
" with error: %s",
638636
rc,
639637
notify_key_id,
640638
sqlite3_errmsg(config_database)
@@ -758,8 +756,7 @@ GglError ggconfig_write_value_at_key(
758756
err = notify_nested_key(key_path, ids);
759757
if (err != GGL_ERR_OK) {
760758
GGL_LOGE(
761-
"Failed to notify all subscribers about update for key path %s "
762-
"with error %s",
759+
"Failed to notify all subscribers about update for key path %s with error %s",
763760
print_key_path(key_path),
764761
ggl_strerror(err)
765762
);
@@ -792,8 +789,7 @@ GglError ggconfig_write_value_at_key(
792789
if (child_is_present) {
793790
GGL_LOGW(
794791
"Key %s with id %" PRId64
795-
" is an object with one or more children, so "
796-
"it can not also store a value. Failing request.",
792+
" is an object with one or more children, so it can not also store a value. Failing request.",
797793
print_key_path(key_path),
798794
last_key_id
799795
);
@@ -809,8 +805,8 @@ GglError ggconfig_write_value_at_key(
809805
}
810806
if (!value_is_present) {
811807
GGL_LOGW(
812-
"Key %s with id %" PRId64 " is an empty map, so it can not have a "
813-
"value written to it. Failing request.",
808+
"Key %s with id %" PRId64
809+
" is an empty map, so it can not have a value written to it. Failing request.",
814810
print_key_path(key_path),
815811
last_key_id
816812
);
@@ -833,8 +829,9 @@ GglError ggconfig_write_value_at_key(
833829
}
834830
if (existing_timestamp > timestamp) {
835831
GGL_LOGD(
836-
"key %s has an existing timestamp %" PRId64 " newer than provided "
837-
"timestamp %" PRId64 ", so it will not be updated",
832+
"key %s has an existing timestamp %" PRId64
833+
" newer than provided timestamp %" PRId64
834+
", so it will not be updated",
838835
print_key_path(key_path),
839836
existing_timestamp,
840837
timestamp
@@ -860,8 +857,7 @@ GglError ggconfig_write_value_at_key(
860857
err = notify_nested_key(key_path, ids);
861858
if (err != GGL_ERR_OK) {
862859
GGL_LOGE(
863-
"failed to notify subscribers about update for key path %s with "
864-
"error %s",
860+
"failed to notify subscribers about update for key path %s with error %s",
865861
print_key_path(key_path),
866862
ggl_strerror(err)
867863
);
@@ -1144,8 +1140,7 @@ GglError ggconfig_list_subkeys(GglList *key_path, GglList *subkeys) {
11441140
}
11451141
if (value_is_present) {
11461142
GGL_LOGW(
1147-
"Key %s is a value, not a map, so subkeys/children can not be "
1148-
"listed.",
1143+
"Key %s is a value, not a map, so subkeys/children can not be listed.",
11491144
print_key_path(key_path)
11501145
);
11511146
sqlite3_exec(config_database, "END TRANSACTION", NULL, NULL, NULL);
@@ -1336,10 +1331,7 @@ GglError ggconfig_delete_key(GglList *key_path) {
13361331
if (err != GGL_ERR_OK) {
13371332
GGL_LOGE(
13381333
"Failed to delete subscribers for id %" PRId64
1339-
" with error %s. This should not happen, but keyids are not "
1340-
"reused and thus "
1341-
"any subscriptions on this key will not be activated anymore, "
1342-
"so execution can continue.",
1334+
" with error %s. This should not happen, but keyids are not reused and thus any subscriptions on this key will not be activated anymore, so execution can continue.",
13431335
descendant_id,
13441336
ggl_strerror(err)
13451337
);

modules/ggdeploymentd/src/bootstrap_manager.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,7 @@ GglError save_component_info(
5757
GglBuffer component_name, GglBuffer component_version, GglBuffer type
5858
) {
5959
GGL_LOGD(
60-
"Saving component name and version for %.*s as type %.*s to the config "
61-
"to track "
62-
"deployment state.",
60+
"Saving component name and version for %.*s as type %.*s to the config to track deployment state.",
6361
(int) component_name.len,
6462
component_name.data,
6563
(int) type.len,
@@ -108,8 +106,7 @@ GglError save_component_info(
108106
}
109107
} else {
110108
GGL_LOGE(
111-
"Invalid component type of %.*s received. Expected type "
112-
"'bootstrap' or 'completed'.",
109+
"Invalid component type of %.*s received. Expected type 'bootstrap' or 'completed'.",
113110
(int) type.len,
114111
type.data
115112
);
@@ -167,8 +164,9 @@ GglError save_iot_jobs_version(int64_t jobs_version) {
167164
}
168165

169166
GglError save_deployment_info(GglDeployment *deployment) {
170-
GGL_LOGD("Encountered component requiring bootstrap. Saving deployment "
171-
"state to config.");
167+
GGL_LOGD(
168+
"Encountered component requiring bootstrap. Saving deployment state to config."
169+
);
172170

173171
GglObject deployment_doc = ggl_obj_map(GGL_MAP(
174172
ggl_kv(

0 commit comments

Comments
 (0)