opensbom-generator / parsers

Language and ecosystem parsers
Apache License 2.0
6 stars 10 forks source link

Cargo module refactor #26

Closed puerco closed 1 year ago

puerco commented 1 year ago

This commit refactors the cargo module to fix a bunch of errors and correct the structure of the generated dependency graph.

The new refactor no longer depends only on cargo --metadata, it is still used but the data is augmented with parsed data from Cargo.toml (for the main project package) and from Cargo.lock (to get the correct module hashes).

This PR adds unit tests to the module, the refactor now includes a mockable implementation to enable us to write integration tests.

/cc @nishakm @cpanato @luhring

puerco commented 1 year ago

_(tests are still not working, we're fixing them so please ignore the failing CI. But hey, the Rust ones work now :smiling_face_withtear: )

puerco commented 1 year ago

Thank you for taking a look!