Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: codellm-devkit/python-sdk
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: codellm-devkit/python-sdk
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: add-go-support
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 6 commits
  • 20 files changed
  • 1 contributor

Commits on Jun 17, 2026

  1. feat: add Go language support via codeanalyzer-go subprocess backend

    Wires CLDK(language="go") end to end:
    
    Models (cldk/models/go/):
    - 9 Pydantic models mirroring codeanalyzer-go schema: GoApplication,
      GoFile, GoType, GoCallable, GoCallsite, GoCallEdge, GoField,
      GoParameter, GoImport, GoComment, GoSymbol, GoVariableDeclaration,
      GoEntrypoint.
    - _NullSafeBase coerces JSON null to empty list/dict for nil-slice
      serialization from Go.
    - GoFile.types / .package_name aliases for spine compatibility.
    
    Analysis facade (cldk/analysis/go/):
    - GoCodeanalyzer subprocess wrapper: shells out to codeanalyzer-go
      binary discovered via shutil.which(); passes --analysis-level as
      integer (1/2), not enum string.
    - GoAnalysis facade: get_application_view, get_symbol_table, get_file,
      get_all_types, get_types_in_file, get_type, get_all_callables,
      get_callables_in_file, get_callable, get_call_graph (nx.DiGraph),
      get_callers, get_callees, get_call_graph_edges.
    
    Core dispatch (cldk/core.py):
    - elif language == "go" branch; rejects source_code mode.
    
    pyproject.toml: codeanalyzer-go = "0.1.0" pinned under
    [tool.backend-versions].
    
    Tests:
    - 17 mocked SDK tests (backend patched, no binary required).
    - 25 E2E tests against a multi-package Go fixture; skipif when
      codeanalyzer-go is absent from PATH.
    - Fixture: calc (Calculator, Operator interface, embedded field,
      pointer/value receivers, multi-return, cross-file method) +
      pipeline (goroutine, variadic, cyclomatic complexity) + main.go.
    
    Signed-off-by: Saurabh Sinha <sinha108@gmail.com>
    sinha108 committed Jun 17, 2026
    Configuration menu
    Copy the full SHA
    5abe90a View commit details
    Browse the repository at this point in the history
  2. docs: add Go to README language support section

    - TOC: add Go under Analysis Backends
    - Mermaid diagram: add cldk.analysis.go → codeanalyzer-go branch and Go models node
    - Update "full support for Java, Python, C" → include Go
    - Update cldk.models example list to include cldk.models.go
    - Add Go backend section: tools, capabilities, prerequisites, usage snippet
    
    Signed-off-by: Saurabh Sinha <sinha108@gmail.com>
    sinha108 committed Jun 17, 2026
    Configuration menu
    Copy the full SHA
    aac1203 View commit details
    Browse the repository at this point in the history

Commits on Jul 3, 2026

  1. merge: bring add-go-support up to date with main + conform Go to new API

    Merges origin/main (40 commits) and adapts the Go language support to the
    refactored per-language factory pattern introduced on main.
    
    Conflict resolutions:
    - pyproject.toml: bump codeanalyzer-java/python/typescript to main versions;
      retain codeanalyzer-go = 0.1.0 in [tool.backend-versions]
    - README.md: adopt main's cleaner structure; add Go row to supported-languages
      table, Go node to architecture Mermaid diagram, CLDK.go() in Quick Start
    - cldk/core.py: keep main's per-language factory layout; add CLDK.go() factory
      and wire Go into the deprecated analysis() shim via GoCodeAnalyzerConfig
    - uv.lock: regenerated from resolved pyproject.toml
    
    API conformance (Go):
    - backend_config.py: add GoCodeAnalyzerConfig dataclass, GoBackend union, and
      "go" key in _CACHE_KEYS so cache_subdir computes the right output path
    - GoAnalysis.__init__: replace (analysis_backend_path, analysis_json_path,
      cache_dir) with backend: GoBackend | None = None; derive output path via
      cache_subdir(backend.cache_dir, project_dir, "go")
    - GoCodeanalyzer.__init__: drop analysis_backend_path (always PATH) and
      cache_dir (folded into analysis_json_path); clean up unused imports
    - core.py: add CLDK.go() static factory; update analysis() Go branch to call
      CLDK.go() with GoCodeAnalyzerConfig
    - Tests: update GoAnalysis instantiations to use new backend= API
    
    Signed-off-by: Saurabh Sinha <sinha108@gmail.com>
    sinha108 committed Jul 3, 2026
    Configuration menu
    Copy the full SHA
    c146713 View commit details
    Browse the repository at this point in the history
  2. fix(go): pass --eager flag to codeanalyzer-go binary when eager_analy…

    …sis=True
    
    Previously GoCodeanalyzer bypassed its own analysis.json cache when
    eager_analysis=True, but never forwarded --eager to the binary. The
    binary's own internal cache (~/.cldk/go-cache) was therefore still used,
    so repeated eager calls could return stale results.
    
    Pass --eager to the subprocess args unconditionally when eager_analysis
    is set; the binary will force a clean rebuild and ignore its cache.
    
    Tests: add test_eager_flag_passed_to_binary and
    test_eager_flag_absent_when_not_eager in test_go_analysis.py, patching
    subprocess.run at the GoCodeanalyzer layer to assert on the argv.
    
    Signed-off-by: Saurabh Sinha <sinha108@gmail.com>
    sinha108 committed Jul 3, 2026
    Configuration menu
    Copy the full SHA
    f9b52ce View commit details
    Browse the repository at this point in the history
  3. fix(go): wire target_files end-to-end through CLDK.go() → GoAnalysis …

    …→ binary
    
    CLDK.go() accepted target_files but neither passed it to GoAnalysis nor did
    GoAnalysis or GoCodeanalyzer forward it to the codeanalyzer-go binary. The
    --target-files flag therefore had no effect, silently ignoring incremental
    mode.
    
    Changes:
    - GoCodeanalyzer.__init__: add target_files: Optional[List[str]] = None;
      append one --target-files <path> per entry in _run_and_parse
    - GoAnalysis.__init__: add target_files param; forward to GoCodeanalyzer
    - CLDK.go(): add target_files param; forward to GoAnalysis
    - analysis() shim: forward target_files to CLDK.go()
    
    Tests: add test_target_files_passed_to_binary and
    test_target_files_absent_when_none in test_go_analysis.py.
    
    Signed-off-by: Saurabh Sinha <sinha108@gmail.com>
    sinha108 committed Jul 3, 2026
    Configuration menu
    Copy the full SHA
    d196199 View commit details
    Browse the repository at this point in the history
  4. feat(go): add GoAnalysisBackend ABC and fix e2e cache path

    Java, Python, and TypeScript all define an abstract base class that
    every analysis backend implements, letting GoAnalysis hold its backend
    via the interface rather than the concrete type. This commit brings Go
    to parity:
    
    - Add cldk/analysis/go/backend.py with GoAnalysisBackend(ABC) exposing
      six abstract methods: get_application, get_symbol_table, get_all_files,
      get_file, get_all_types, get_all_callables.
    - Make GoCodeanalyzer subclass GoAnalysisBackend (satisfies ABC at class
      definition time; TypeError at startup if any abstract method is missing).
    - Type GoAnalysis._codeanalyzer as GoAnalysisBackend so static type
      checkers enforce the interface boundary.
    - Export GoAnalysisBackend from cldk/analysis/go/__init__.py.
    - Add two unit tests: GoCodeanalyzer is a subclass of GoAnalysisBackend
      (issubclass), and GoAnalysis._codeanalyzer is a GoAnalysisBackend
      instance at runtime (subprocess-stub pattern, no mock needed).
    - Fix test_e2e_application_round_trips_pydantic: cache_subdir writes
      analysis.json under <cache_dir>/go/, not directly under cache_dir.
    
    Signed-off-by: Saurabh Sinha <sinha108@gmail.com>
    sinha108 committed Jul 3, 2026
    Configuration menu
    Copy the full SHA
    31e497f View commit details
    Browse the repository at this point in the history
Loading