Skip to content

Commit b7f1a71

Browse files
committed
style: apply clang-format to new mcp/ui/logging lines
The CI lint gate (scripts/lint.sh --ci, clang-format-20) flagged 7 files whose new lines were not run through the project formatter. Reformat only those lines (line wrapping / continuation alignment) — no behavior change. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent 345425a commit b7f1a71

7 files changed

Lines changed: 23 additions & 25 deletions

File tree

‎src/mcp/mcp.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,8 @@ static const tool_def_t TOOLS[] = {
326326
"\"description\":\"Projects to search for cross-repo links (cross-repo-intelligence mode). "
327327
"Use [\\\"*\\\"] for all indexed projects. Run list_projects to see available projects.\"},"
328328
"\"name\":{\"type\":\"string\",\"description\":"
329-
"\"Override the derived project name. Non-ASCII bytes are encoded and unsafe path characters are normalized.\"},"
329+
"\"Override the derived project name. Non-ASCII bytes are encoded and unsafe path characters "
330+
"are normalized.\"},"
330331
"\"persistence\":{\"type\":\"boolean\",\"default\":false,\"description\":"
331332
"\"Write compressed artifact to .codebase-memory/graph.db.zst for team sharing. "
332333
"Teammates can bootstrap from the artifact instead of full re-indexing.\"}"

‎src/ui/http_server.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -925,8 +925,7 @@ static void handle_index_start(cbm_http_conn_t *c, const cbm_http_req_t *req) {
925925
}
926926
const char *rpath = yyjson_get_str(v_path);
927927
yyjson_val *v_project_name = yyjson_obj_get(root, "project_name");
928-
const char *project_name =
929-
yyjson_is_str(v_project_name) ? yyjson_get_str(v_project_name) : "";
928+
const char *project_name = yyjson_is_str(v_project_name) ? yyjson_get_str(v_project_name) : "";
930929

931930
/* Check path exists */
932931
if (!cbm_is_dir(rpath)) {

‎src/ui/httpd.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,7 @@ int cbm_http_parse_head(const char *data, size_t len, cbm_http_req_t *req, size_
343343
if (header_name_is(p, nlen, "origin")) {
344344
copy_header_value(colon + 1, eol, req->origin, sizeof(req->origin));
345345
} else if (header_name_is(p, nlen, "accept-language")) {
346-
copy_header_value(colon + 1, eol, req->accept_language,
347-
sizeof(req->accept_language));
346+
copy_header_value(colon + 1, eol, req->accept_language, sizeof(req->accept_language));
348347
} else if (header_name_is(p, nlen, "transfer-encoding")) {
349348
/* Chunked (or any transfer coding) is not supported. */
350349
return 411;

‎tests/test_fqn.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -484,9 +484,8 @@ TEST(project_name_encodes_unicode_segments_issue571) {
484484
"\xe5\x90\x8e\xe7\xab\xaf/"
485485
"\xe4\xbf\xa1\xe7\xa7\x9f\xe9\xa3\x8e\xe6\x8e\xa7\xe9\x80\x9a\xe5\x90\x8e\xe7\xab\xaf");
486486
ASSERT_NOT_NULL(got);
487-
ASSERT_STR_EQ(got,
488-
"Users-yunxin-Desktop-e5bc80e58f91-e5908ee7abaf-"
489-
"e4bfa1e7a79fe9a38ee68ea7e9809ae5908ee7abaf");
487+
ASSERT_STR_EQ(got, "Users-yunxin-Desktop-e5bc80e58f91-e5908ee7abaf-"
488+
"e4bfa1e7a79fe9a38ee68ea7e9809ae5908ee7abaf");
490489
ASSERT_TRUE(cbm_validate_project_name(got));
491490
free(got);
492491
PASS();

‎tests/test_httpd.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,8 @@ TEST(httpd_resolves_bare_binary_path_from_path) {
353353
cbm_setenv("PATH", td, 1);
354354

355355
char resolved[1024];
356-
ASSERT_TRUE(cbm_http_server_resolve_binary_path("codebase-memory-mcp", resolved,
357-
sizeof(resolved)));
356+
ASSERT_TRUE(
357+
cbm_http_server_resolve_binary_path("codebase-memory-mcp", resolved, sizeof(resolved)));
358358
ASSERT_STR_EQ(resolved, exe);
359359

360360
if (old_path) {

‎tests/test_main.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ static bool suite_requested(const char *name) {
2828
return false;
2929
}
3030

31-
#define RUN_SELECTED_SUITE(name) \
32-
do { \
33-
if (suite_requested(#name)) { \
34-
RUN_SUITE(name); \
35-
} \
31+
#define RUN_SELECTED_SUITE(name) \
32+
do { \
33+
if (suite_requested(#name)) { \
34+
RUN_SUITE(name); \
35+
} \
3636
} while (0)
3737

3838
/* Forward declarations of suite functions */

‎tests/test_mcp.c‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -608,11 +608,11 @@ TEST(tool_search_graph_query_honors_file_pattern_issue552) {
608608
"FROM nodes;"),
609609
CBM_STORE_OK);
610610

611-
char *resp = cbm_mcp_server_handle(
612-
srv, "{\"jsonrpc\":\"2.0\",\"id\":552,\"method\":\"tools/call\","
613-
"\"params\":{\"name\":\"search_graph\","
614-
"\"arguments\":{\"project\":\"issue-552\",\"query\":\"status\","
615-
"\"file_pattern\":\"src/lib/*\",\"limit\":10}}}");
611+
char *resp =
612+
cbm_mcp_server_handle(srv, "{\"jsonrpc\":\"2.0\",\"id\":552,\"method\":\"tools/call\","
613+
"\"params\":{\"name\":\"search_graph\","
614+
"\"arguments\":{\"project\":\"issue-552\",\"query\":\"status\","
615+
"\"file_pattern\":\"src/lib/*\",\"limit\":10}}}");
616616
ASSERT_NOT_NULL(resp);
617617
char *inner = extract_text_content(resp);
618618
ASSERT_NOT_NULL(inner);
@@ -943,11 +943,11 @@ TEST(tool_get_architecture_path_scoping) {
943943
ASSERT_NOT_NULL(inner_root);
944944
ASSERT_NOT_NULL(strstr(inner_root, "Django"));
945945

946-
char *resp_scoped = cbm_mcp_server_handle(
947-
srv, "{\"jsonrpc\":\"2.0\",\"id\":93,\"method\":\"tools/call\","
948-
"\"params\":{\"name\":\"get_architecture\","
949-
"\"arguments\":{\"project\":\"arch-path\",\"path\":\"apps/hoa\","
950-
"\"aspects\":[\"packages\"]}}}");
946+
char *resp_scoped =
947+
cbm_mcp_server_handle(srv, "{\"jsonrpc\":\"2.0\",\"id\":93,\"method\":\"tools/call\","
948+
"\"params\":{\"name\":\"get_architecture\","
949+
"\"arguments\":{\"project\":\"arch-path\",\"path\":\"apps/hoa\","
950+
"\"aspects\":[\"packages\"]}}}");
951951
ASSERT_NOT_NULL(resp_scoped);
952952
char *inner_scoped = extract_text_content(resp_scoped);
953953
ASSERT_NOT_NULL(inner_scoped);

0 commit comments

Comments
 (0)