Skip to content

Local code intelligence for developers and AI agents. Connect code, docs and infrastructure in a persistent graph, with CBM Lens, MCP tools, agent integrations and change-aware test selection.

style: apply clang-format to new mcp/ui/logging lines

Martin Vogelb7f1a71a6b94
diff --git a/src/mcp/mcp.c b/src/mcp/mcp.c
index a6bebb779..5235aaab5 100644
--- a/src/mcp/mcp.c
+++ b/src/mcp/mcp.c
@@ -326,7 +326,8 @@ static const tool_def_t TOOLS[] = {
"\"description\":\"Projects to search for cross-repo links (cross-repo-intelligence mode). "
"Use [\\\"*\\\"] for all indexed projects. Run list_projects to see available projects.\"},"
"\"name\":{\"type\":\"string\",\"description\":"
- "\"Override the derived project name. Non-ASCII bytes are encoded and unsafe path characters are normalized.\"},"
+ "\"Override the derived project name. Non-ASCII bytes are encoded and unsafe path characters "
+ "are normalized.\"},"
"\"persistence\":{\"type\":\"boolean\",\"default\":false,\"description\":"
"\"Write compressed artifact to .codebase-memory/graph.db.zst for team sharing. "
"Teammates can bootstrap from the artifact instead of full re-indexing.\"}"
diff --git a/src/ui/http_server.c b/src/ui/http_server.c
index fc6c6c710..c12685ef9 100644
--- a/src/ui/http_server.c
+++ b/src/ui/http_server.c
@@ -925,8 +925,7 @@ static void handle_index_start(cbm_http_conn_t *c, const cbm_http_req_t *req) {
}
const char *rpath = yyjson_get_str(v_path);
yyjson_val *v_project_name = yyjson_obj_get(root, "project_name");
- const char *project_name =
- yyjson_is_str(v_project_name) ? yyjson_get_str(v_project_name) : "";
+ const char *project_name = yyjson_is_str(v_project_name) ? yyjson_get_str(v_project_name) : "";
/* Check path exists */
if (!cbm_is_dir(rpath)) {
diff --git a/src/ui/httpd.c b/src/ui/httpd.c
index c268b0900..da5f0146f 100644
--- a/src/ui/httpd.c
+++ b/src/ui/httpd.c
@@ -343,8 +343,7 @@ int cbm_http_parse_head(const char *data, size_t len, cbm_http_req_t *req, size_
if (header_name_is(p, nlen, "origin")) {
copy_header_value(colon + 1, eol, req->origin, sizeof(req->origin));
} else if (header_name_is(p, nlen, "accept-language")) {
- copy_header_value(colon + 1, eol, req->accept_language,
- sizeof(req->accept_language));
+ copy_header_value(colon + 1, eol, req->accept_language, sizeof(req->accept_language));
} else if (header_name_is(p, nlen, "transfer-encoding")) {
/* Chunked (or any transfer coding) is not supported. */
return 411;
diff --git a/tests/test_fqn.c b/tests/test_fqn.c
index 69b87d053..798974f13 100644
--- a/tests/test_fqn.c
+++ b/tests/test_fqn.c
@@ -484,9 +484,8 @@ TEST(project_name_encodes_unicode_segments_issue571) {
"\xe5\x90\x8e\xe7\xab\xaf/"
"\xe4\xbf\xa1\xe7\xa7\x9f\xe9\xa3\x8e\xe6\x8e\xa7\xe9\x80\x9a\xe5\x90\x8e\xe7\xab\xaf");
ASSERT_NOT_NULL(got);
- ASSERT_STR_EQ(got,
- "Users-yunxin-Desktop-e5bc80e58f91-e5908ee7abaf-"
- "e4bfa1e7a79fe9a38ee68ea7e9809ae5908ee7abaf");
+ ASSERT_STR_EQ(got, "Users-yunxin-Desktop-e5bc80e58f91-e5908ee7abaf-"
+ "e4bfa1e7a79fe9a38ee68ea7e9809ae5908ee7abaf");
ASSERT_TRUE(cbm_validate_project_name(got));
free(got);
PASS();
diff --git a/tests/test_httpd.c b/tests/test_httpd.c
index 8fb5acf46..ddbca5568 100644
--- a/tests/test_httpd.c
+++ b/tests/test_httpd.c
@@ -353,8 +353,8 @@ TEST(httpd_resolves_bare_binary_path_from_path) {
cbm_setenv("PATH", td, 1);
char resolved[1024];
- ASSERT_TRUE(cbm_http_server_resolve_binary_path("codebase-memory-mcp", resolved,
- sizeof(resolved)));
+ ASSERT_TRUE(
+ cbm_http_server_resolve_binary_path("codebase-memory-mcp", resolved, sizeof(resolved)));
ASSERT_STR_EQ(resolved, exe);
if (old_path) {
diff --git a/tests/test_main.c b/tests/test_main.c
index 227e838dd..824b91fe8 100644
--- a/tests/test_main.c
+++ b/tests/test_main.c
@@ -28,11 +28,11 @@ static bool suite_requested(const char *name) {
return false;
}
-#define RUN_SELECTED_SUITE(name) \
- do { \
- if (suite_requested(#name)) { \
- RUN_SUITE(name); \
- } \
+#define RUN_SELECTED_SUITE(name) \
+ do { \
+ if (suite_requested(#name)) { \
+ RUN_SUITE(name); \
+ } \
} while (0)
/* Forward declarations of suite functions */
diff --git a/tests/test_mcp.c b/tests/test_mcp.c
index 1e3461231..3bfb45c8f 100644
--- a/tests/test_mcp.c
+++ b/tests/test_mcp.c
@@ -608,11 +608,11 @@ TEST(tool_search_graph_query_honors_file_pattern_issue552) {
"FROM nodes;"),
CBM_STORE_OK);
- char *resp = cbm_mcp_server_handle(
- srv, "{\"jsonrpc\":\"2.0\",\"id\":552,\"method\":\"tools/call\","
- "\"params\":{\"name\":\"search_graph\","
- "\"arguments\":{\"project\":\"issue-552\",\"query\":\"status\","
- "\"file_pattern\":\"src/lib/*\",\"limit\":10}}}");
+ char *resp =
+ cbm_mcp_server_handle(srv, "{\"jsonrpc\":\"2.0\",\"id\":552,\"method\":\"tools/call\","
+ "\"params\":{\"name\":\"search_graph\","
+ "\"arguments\":{\"project\":\"issue-552\",\"query\":\"status\","
+ "\"file_pattern\":\"src/lib/*\",\"limit\":10}}}");
ASSERT_NOT_NULL(resp);
char *inner = extract_text_content(resp);
ASSERT_NOT_NULL(inner);
@@ -943,11 +943,11 @@ TEST(tool_get_architecture_path_scoping) {
ASSERT_NOT_NULL(inner_root);
ASSERT_NOT_NULL(strstr(inner_root, "Django"));
- char *resp_scoped = cbm_mcp_server_handle(
- srv, "{\"jsonrpc\":\"2.0\",\"id\":93,\"method\":\"tools/call\","
- "\"params\":{\"name\":\"get_architecture\","
- "\"arguments\":{\"project\":\"arch-path\",\"path\":\"apps/hoa\","
- "\"aspects\":[\"packages\"]}}}");
+ char *resp_scoped =
+ cbm_mcp_server_handle(srv, "{\"jsonrpc\":\"2.0\",\"id\":93,\"method\":\"tools/call\","
+ "\"params\":{\"name\":\"get_architecture\","
+ "\"arguments\":{\"project\":\"arch-path\",\"path\":\"apps/hoa\","
+ "\"aspects\":[\"packages\"]}}}");
ASSERT_NOT_NULL(resp_scoped);
char *inner_scoped = extract_text_content(resp_scoped);
ASSERT_NOT_NULL(inner_scoped);