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

Add line-numbers to the output #150

Open
agmond opened this issue Jan 17, 2023 · 5 comments
Open

Add line-numbers to the output #150

agmond opened this issue Jan 17, 2023 · 5 comments
Labels
backlog Important but currently unprioritized enhancement New feature or request

Comments

@agmond
Copy link

agmond commented Jan 17, 2023

Hi,
It would be great to add the line numbers of the package in the input file to the output (at least to the JSON output).
Thanks!

@G-Rath
Copy link
Collaborator

G-Rath commented Jan 17, 2023

This has previously been mentioned here - effectively this would require implementing custom parsers for at least JSON, YAML, TOML, and XML since none of the libraries the scanner uses for those provide line numbers in any form, and that would be a huge jump in complexity.

I'm not really sure how useful line numbers would be either for most of the parsers since they're meant to be generated files.

@agmond
Copy link
Author

agmond commented Jan 17, 2023

Thanks, @G-Rath.
If, as already mentioned in #57, one of the future directions is adding remediation capabilities, then adding the line numbers can help.
Ideally, I'd want to get the line number in the non-generated form of the file. For example, get the relevant line number in the package.json file that generated the package-lock.json.
Anyway, some other file formats can easily benefit from this addition directly (e.g. requirements.txt), so maybe it can be added as optional.

@oliverchang oliverchang added the enhancement New feature or request label Jan 17, 2023
@oliverchang
Copy link
Collaborator

+1 to this being useful for remediation in the future, and enable very nice output integrations with e.g. SARIF. @another-rex thoughts?

@picatz
Copy link

picatz commented Jan 30, 2023

I'd love to see this happen, and as @oliverchang points out, it would be useful for SARIF integration. Otherwise, currently, I have to provide fake location information (top of the file) to make this work with a SARIF viewer (GitHub's code scanning tab).

Copy link

This issue has not had any activity for 60 days and will be automatically closed in two weeks

@github-actions github-actions bot added the stale The issue or PR is stale and pending automated closure label Jul 24, 2024
@oliverchang oliverchang added backlog Important but currently unprioritized and removed stale The issue or PR is stale and pending automated closure labels Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Important but currently unprioritized enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants