Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cargo]: Incorrect version number parsing in cargo.toml #1592

Open
Code-Agitator opened this issue Jan 23, 2025 · 2 comments
Open

[cargo]: Incorrect version number parsing in cargo.toml #1592

Code-Agitator opened this issue Jan 23, 2025 · 2 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@Code-Agitator
Copy link
Contributor

Case

[dependencies]
serde_json = { version = "1.0.128" }

Issue Description

In the provided cargo.toml file, the version number for the dependency serde_json is specified as 1.0.128 }

@prabhu prabhu added the bug Something isn't working label Jan 23, 2025
@prabhu
Copy link
Collaborator

prabhu commented Jan 23, 2025

We introduced a toml library quite late to the project, so there is a lot of code that is parsing the toml files manually.

cargoData.split("\n").forEach((l) => {

I think it is a good idea to refactor all cargo parsing methods to use toml library. Would you be interested in contributing a PR?

@prabhu prabhu moved this to Open to New contributors in cdxgen top issues Jan 23, 2025
@prabhu prabhu added the good first issue Good for newcomers label Jan 23, 2025
@Code-Agitator
Copy link
Contributor Author

@prabhu Thank you for the invitation, this is indeed a good idea. I will try to complete it, and if I can do it well, I will submit a PR.

Code-Agitator added a commit to Code-Agitator/cdxgen that referenced this issue Jan 24, 2025
Code-Agitator added a commit to Code-Agitator/cdxgen that referenced this issue Feb 5, 2025
Code-Agitator added a commit to Code-Agitator/cdxgen that referenced this issue Feb 7, 2025
prabhu pushed a commit to Code-Agitator/cdxgen that referenced this issue Feb 18, 2025
prabhu added a commit that referenced this issue Feb 18, 2025
… (#1595)

* Refactor toml and lock file in cargo parsing using `@iarna/toml`(#1592)

Signed-off-by: Lizhe Lv <[email protected]>

* Optimize cargo dependencies parsing

Signed-off-by: Lizhe Lv <[email protected]>

* lint

Signed-off-by: Prabhu Subramanian <[email protected]>

* Bug fix

Signed-off-by: Prabhu Subramanian <[email protected]>

---------

Signed-off-by: Lizhe Lv <[email protected]>
Signed-off-by: Prabhu Subramanian <[email protected]>
Co-authored-by: Prabhu Subramanian <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
Status: Open to New contributors
Development

No branches or pull requests

2 participants