Skip to content

Commit 7814568

Browse files
committed
style: clang-format issue-batch additions (cypher/mcp)
Fixes the dry-run lint failure: the DeusData#627 cypher and DeusData#514/DeusData#520/DeusData#546 mcp additions had lines exceeding the column limit. clang-format 22.1.1 (project version) wraps them; no logic change. Signed-off-by: Martin Vogel <[email protected]>
1 parent da506f7 commit 7814568

2 files changed

Lines changed: 17 additions & 15 deletions

File tree

‎src/cypher/cypher.c‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4228,14 +4228,16 @@ static void cross_join_with_rels(cbm_store_t *store, cbm_pattern_t *patn, bindin
42284228
* Instead we scan only the bound terminal's edges and bind `c` to real
42294229
* neighbours; with OPTIONAL we keep the row with `c` unbound when there are
42304230
* none — the correct dead-code semantics. */
4231-
static void expand_from_bound_terminal(cbm_store_t *store, cbm_pattern_t *patn, binding_t **bindings,
4232-
int *bind_count, const char *start_var, bool opt) {
4231+
static void expand_from_bound_terminal(cbm_store_t *store, cbm_pattern_t *patn,
4232+
binding_t **bindings, int *bind_count, const char *start_var,
4233+
bool opt) {
42334234
cbm_rel_pattern_t *rel = &patn->rels[0];
42344235
const cbm_node_pattern_t *start_node = &patn->nodes[0];
42354236
/* The relationship is written start-[r]->terminal. To enumerate the start
42364237
* nodes reachable from the bound terminal we invert the stored direction. */
42374238
bool rel_inbound = rel->direction && strcmp(rel->direction, "inbound") == 0;
4238-
bool scan_targets = !rel_inbound; /* (start)->(term): start = edge source = scan term's inbound */
4239+
bool scan_targets =
4240+
!rel_inbound; /* (start)->(term): start = edge source = scan term's inbound */
42394241

42404242
size_t alloc_n = (size_t)*bind_count * (size_t)CYP_GROWTH_10 + SKIP_ONE;
42414243
binding_t *new_bindings = malloc(alloc_n * sizeof(binding_t));
@@ -4250,8 +4252,8 @@ static void expand_from_bound_terminal(cbm_store_t *store, cbm_pattern_t *patn,
42504252
cbm_node_t *term = binding_get(b, patn->nodes[1].variable ? patn->nodes[1].variable : "");
42514253
int match_count = 0;
42524254
if (term) {
4253-
for (int ti = 0; ti < (rel->type_count > 0 ? rel->type_count : 1) && new_count < max_new;
4254-
ti++) {
4255+
for (int ti = 0;
4256+
ti < (rel->type_count > 0 ? rel->type_count : 1) && new_count < max_new; ti++) {
42554257
cbm_edge_t *edges = NULL;
42564258
int edge_count = 0;
42574259
if (rel->type_count > 0) {

‎src/mcp/mcp.c‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2606,19 +2606,19 @@ static char *handle_trace_call_path(cbm_mcp_server_t *srv, const char *args) {
26062606
(void)sel; /* union across all same-name nodes — see bfs_union_same_name (#546) */
26072607

26082608
if (do_outbound) {
2609-
bfs_union_same_name(store, nodes, node_count, "outbound", edge_types, edge_type_count, depth,
2610-
&tr_out);
2611-
yyjson_mut_obj_add_val(doc, root, "callees",
2612-
bfs_to_json_array(doc, &tr_out, risk_labels, include_tests,
2613-
data_flow));
2609+
bfs_union_same_name(store, nodes, node_count, "outbound", edge_types, edge_type_count,
2610+
depth, &tr_out);
2611+
yyjson_mut_obj_add_val(
2612+
doc, root, "callees",
2613+
bfs_to_json_array(doc, &tr_out, risk_labels, include_tests, data_flow));
26142614
}
26152615

26162616
if (do_inbound) {
26172617
bfs_union_same_name(store, nodes, node_count, "inbound", edge_types, edge_type_count, depth,
26182618
&tr_in);
2619-
yyjson_mut_obj_add_val(doc, root, "callers",
2620-
bfs_to_json_array(doc, &tr_in, risk_labels, include_tests,
2621-
data_flow));
2619+
yyjson_mut_obj_add_val(
2620+
doc, root, "callers",
2621+
bfs_to_json_array(doc, &tr_in, risk_labels, include_tests, data_flow));
26222622
}
26232623

26242624
/* Serialize BEFORE freeing traversal results (yyjson borrows strings) */
@@ -4420,8 +4420,8 @@ static char *handle_detect_changes(cbm_mcp_server_t *srv, const char *args) {
44204420
* prefix when present so all three sources yield clean paths; for a
44214421
* rename ("R old -> new") keep the post-arrow destination path. */
44224422
char *path_line = line;
4423-
if (len > PAIR_LEN && line[PAIR_LEN] == ' ' &&
4424-
strchr(" MADRCU?!", line[0]) && strchr(" MADRCU?!", line[1])) {
4423+
if (len > PAIR_LEN && line[PAIR_LEN] == ' ' && strchr(" MADRCU?!", line[0]) &&
4424+
strchr(" MADRCU?!", line[1])) {
44254425
path_line = line + PAIR_LEN + SKIP_ONE;
44264426
char *arrow = strstr(path_line, " -> ");
44274427
if (arrow) {

0 commit comments

Comments
 (0)