Skip to content

Add support for parsing go mod graph dumps - #5300

Open
arbazkhan971 wants to merge 1 commit into
aboutcode-org:developfrom
arbazkhan971:add-go-mod-graph
Open

Add support for parsing go mod graph dumps#5300
arbazkhan971 wants to merge 1 commit into
aboutcode-org:developfrom
arbazkhan971:add-go-mod-graph

Conversation

@arbazkhan971

Copy link
Copy Markdown

Summary

Adds a package datafile handler for the `go mod graph` text format.

  • Recognizes `go-mod-graph.deplock` (DepLock-style, same idea as `swift-show-dependencies.deplock` / `pip-inspect.deplock`) and `go.mod.graph`
  • Treats the first requiring module as the main module
  • Collects unique required modules; those required by the main module are direct, the rest are transitive
  • Graph versions are the selected versions, so dependencies are pinned

Test plan

  • `pytest tests/packagedcode/test_golang.py` (16 passed)
  • `test_recognize_go_mod_graph`
  • `test_package_list_command`
  • `test_check_datafile_handlers_have_no_duplicate_datasource_id`
  • doctests in `go_mod.py`

Fixes #4423

Made with Cursor

Signed-off-by: Arbaz Khan <arbazkhan971@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Go module graph

1 participant