diff --git a/internal/cbm/extract_defs.c b/internal/cbm/extract_defs.c index b6f101841..e0b6ca5f6 100644 --- a/internal/cbm/extract_defs.c +++ b/internal/cbm/extract_defs.c @@ -608,8 +608,7 @@ static TSNode resolve_toplevel_arrow_name(TSNode node, const char *kind) { return null_node; } const char *pk = ts_node_type(parent); - if (strcmp(pk, "variable_declarator") == 0 || - strcmp(pk, "public_field_definition") == 0) { + if (strcmp(pk, "variable_declarator") == 0 || strcmp(pk, "public_field_definition") == 0) { /* `const f = () => {}` and the class-field form `f = () => {}` both name * the arrow via the parent's `name` child (#new_ts_class_field_arrow): * resolving it lets push_boundary_scopes push a SCOPE_FUNC so in-body @@ -861,8 +860,8 @@ TSNode cbm_resolve_func_name(TSNode node, CBMLanguage lang) { * field (the field is only populated for the bare `function foo()` form). * func_name_node() already handled the field case above; here we cover the * function_name child so local functions also produce a Function def. */ - if (lang == CBM_LANG_TEAL && (strcmp(kind, "function_statement") == 0 || - strcmp(kind, "function_signature") == 0)) { + if (lang == CBM_LANG_TEAL && + (strcmp(kind, "function_statement") == 0 || strcmp(kind, "function_signature") == 0)) { TSNode fn = cbm_find_child_by_kind(node, "function_name"); if (!ts_node_is_null(fn)) { return fn; @@ -3784,9 +3783,8 @@ static TSNode resolve_method_name(TSNode child, CBMLanguage lang) { // Pony: `fun`/`be`/`new` members are `method`/`constructor`/`ffi_method` // nodes with no `name` field; the name is the first plain `identifier` child // (mirrors the free-function case in cbm_resolve_func_name). - if (lang == CBM_LANG_PONY && - (strcmp(ck, "method") == 0 || strcmp(ck, "constructor") == 0 || - strcmp(ck, "ffi_method") == 0)) { + if (lang == CBM_LANG_PONY && (strcmp(ck, "method") == 0 || strcmp(ck, "constructor") == 0 || + strcmp(ck, "ffi_method") == 0)) { return cbm_find_child_by_kind(child, "identifier"); } @@ -4925,8 +4923,7 @@ static void extract_var_names(CBMExtractCtx *ctx, TSNode node, const CBMLangSpec * named by its module_path. The default fallback misses both (no `name` * field; child is a require_spec, not a bare identifier). */ case CBM_LANG_GOMOD: - if (strcmp(kind, "require_directive") == 0 || - strcmp(kind, "replace_directive") == 0) { + if (strcmp(kind, "require_directive") == 0 || strcmp(kind, "replace_directive") == 0) { uint32_t rc = ts_node_named_child_count(node); for (uint32_t i = 0; i < rc; i++) { TSNode spec = ts_node_named_child(node, i); diff --git a/internal/cbm/extract_unified.c b/internal/cbm/extract_unified.c index a6685d993..54847bc79 100644 --- a/internal/cbm/extract_unified.c +++ b/internal/cbm/extract_unified.c @@ -96,14 +96,26 @@ static bool lisp_head_is_def(const char *t) { if (!t) { return false; } - static const char *heads[] = { - "defn", "defn-", "def", - "defmacro", "defmulti", "defmethod", - "defprotocol", "defrecord", "deftype", - "definterface", "defonce", "define", - "define-syntax", "define-values", "define-syntax-rule", - "define-struct", "define-record-type", "define/contract", - "struct", NULL}; + static const char *heads[] = {"defn", + "defn-", + "def", + "defmacro", + "defmulti", + "defmethod", + "defprotocol", + "defrecord", + "deftype", + "definterface", + "defonce", + "define", + "define-syntax", + "define-values", + "define-syntax-rule", + "define-struct", + "define-record-type", + "define/contract", + "struct", + NULL}; for (int i = 0; heads[i]; i++) { if (strcmp(t, heads[i]) == 0) { return true; @@ -265,8 +277,7 @@ static const char *compute_func_qn(CBMExtractCtx *ctx, TSNode node, const CBMLan * is available to read the attribute. Other CFML func nodes (embedded * CFScript function_declaration/_expression) fall through to the shared * resolver below. */ - if (ctx->language == CBM_LANG_CFML && - strcmp(ts_node_type(node), "cf_function_tag") == 0) { + if (ctx->language == CBM_LANG_CFML && strcmp(ts_node_type(node), "cf_function_tag") == 0) { return compute_cfml_func_qn(ctx, node); } diff --git a/internal/cbm/helpers.c b/internal/cbm/helpers.c index 2235f8371..eda44bece 100644 --- a/internal/cbm/helpers.c +++ b/internal/cbm/helpers.c @@ -150,10 +150,9 @@ static const char *generic_keywords[] = { * which are ordinary built-in functions invoked as calls. Using the generic * list would wrongly drop `include`/`require` call edges, so Puppet gets its * own reserved-word set that omits them. */ -static const char *puppet_keywords[] = { - "true", "false", "undef", "if", "elsif", "else", "unless", "case", - "and", "or", "in", "node", "class", "define", "inherits", "default", - "return", NULL}; +static const char *puppet_keywords[] = {"true", "false", "undef", "if", "elsif", "else", + "unless", "case", "and", "or", "in", "node", + "class", "define", "inherits", "default", "return", NULL}; // True when `label` names a type-like container definition (see cbm.h). Single // source of truth for the type-resolution / registry / IMPLEMENTS / LSP-type @@ -884,9 +883,7 @@ const char *cbm_enclosing_func_qn(CBMArena *a, TSNode node, CBMLanguage lang, co if (!cname || !cname[0]) { continue; } - class_chain = class_chain - ? cbm_arena_sprintf(a, "%s.%s", cname, class_chain) - : cname; + class_chain = class_chain ? cbm_arena_sprintf(a, "%s.%s", cname, class_chain) : cname; } if (class_chain) { const char *class_qn = cbm_fqn_compute(a, project, rel_path, class_chain); diff --git a/internal/cbm/lang_specs.c b/internal/cbm/lang_specs.c index 74263541a..88f72aeb7 100644 --- a/internal/cbm/lang_specs.c +++ b/internal/cbm/lang_specs.c @@ -1430,8 +1430,8 @@ static const char *kconfig_module_types[] = {"source", NULL}; /* `anonymous_python_function` is the tree-sitter-bitbake node for a * `python do_foo() {...}` task; `function_definition` is a `do_foo() {...}` * shell task. (`recipe` is the file root, not a function.) */ -static const char *bitbake_func_types[] = {"function_definition", - "anonymous_python_function", NULL}; +static const char *bitbake_func_types[] = {"function_definition", "anonymous_python_function", + NULL}; static const char *bitbake_var_types[] = {"variable_assignment", NULL}; static const char *bitbake_call_types[] = {"call", NULL}; static const char *bitbake_import_types[] = { diff --git a/src/pipeline/pass_calls.c b/src/pipeline/pass_calls.c index 61f5ac5df..66b94a106 100644 --- a/src/pipeline/pass_calls.c +++ b/src/pipeline/pass_calls.c @@ -452,10 +452,9 @@ static int resolve_single_call(cbm_pipeline_ctx_t *ctx, CBMCall *call, cbm_svc_kind_t esvc = cbm_service_pattern_match(call->callee_name); if (esvc == CBM_SVC_HTTP || esvc == CBM_SVC_ASYNC) { const char *u = call->first_string_arg; - bool has_url_or_topic = - u && u[0] != '\0' && - (u[0] == '/' || strstr(u, "://") != NULL || - (esvc == CBM_SVC_ASYNC && strlen(u) > PAIR_LEN)); + bool has_url_or_topic = u && u[0] != '\0' && + (u[0] == '/' || strstr(u, "://") != NULL || + (esvc == CBM_SVC_ASYNC && strlen(u) > PAIR_LEN)); if (has_url_or_topic) { cbm_resolution_t svc_res = {.qualified_name = call->callee_name, .confidence = PC_SVC_PATTERN_CONF, @@ -492,9 +491,9 @@ static int resolve_single_call(cbm_pipeline_ctx_t *ctx, CBMCall *call, cbm_svc_kind_t svc = cbm_service_pattern_match(res.qualified_name); if (svc == CBM_SVC_HTTP || svc == CBM_SVC_ASYNC) { const char *u = call->first_string_arg; - bool has_url_or_topic = - u && u[0] != '\0' && - (u[0] == '/' || strstr(u, "://") != NULL || (svc == CBM_SVC_ASYNC && strlen(u) > PAIR_LEN)); + bool has_url_or_topic = u && u[0] != '\0' && + (u[0] == '/' || strstr(u, "://") != NULL || + (svc == CBM_SVC_ASYNC && strlen(u) > PAIR_LEN)); if (has_url_or_topic) { emit_http_async_edge(ctx, call, source_node, NULL, &res, svc); return SKIP_ONE; diff --git a/src/pipeline/pipeline.c b/src/pipeline/pipeline.c index eb4327da5..12eac8b86 100644 --- a/src/pipeline/pipeline.c +++ b/src/pipeline/pipeline.c @@ -502,9 +502,8 @@ static bool is_upstream_config_key(const char *key_path) { /* No key context (e.g. flat string) — keep prior behaviour and mint. */ return false; } - static const char *const deny[] = {"jwks", "registry", "registries", - "healthcheck", "upstream", "_service_url", - "auth", NULL}; + static const char *const deny[] = {"jwks", "registry", "registries", "healthcheck", + "upstream", "_service_url", "auth", NULL}; for (int i = 0; deny[i]; i++) { if (strstr(key_path, deny[i]) != NULL) { return true; diff --git a/src/store/store.h b/src/store/store.h index c0fc189c0..2471a16f1 100644 --- a/src/store/store.h +++ b/src/store/store.h @@ -148,7 +148,7 @@ typedef struct { const char *to_name; const char *type; double confidence; - int64_t source_id; /* edge endpoints — let callers match an edge to a hop node */ + int64_t source_id; /* edge endpoints — let callers match an edge to a hop node */ int64_t target_id; const char *properties_json; /* raw edge properties (carries CALLS arg expressions) */ } cbm_edge_info_t;