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

It'd be nice to have line numbers from wolfictl lint #1203

Open
justinvreeland opened this issue Sep 23, 2024 · 1 comment
Open

It'd be nice to have line numbers from wolfictl lint #1203

justinvreeland opened this issue Sep 23, 2024 · 1 comment
Labels
enhancement New feature or request needs-triage applied to all new customer/user issues. Removed after triage occurs.

Comments

@justinvreeland
Copy link
Member

Many editors have the ability to retrieve diagnostic information from various tools to report problems in gutters or tooltips and the like. I'd like to do the same for Wolfi packages but the linter doesn't provide line numbers which would be the main advantage to editor integration. For some messages there's no specific line number and probably the top of the block should be used for example:

wolfictl lint curl.yaml
2024/09/12 09:48:55 INFO Package: curl: [contains-epoch]: config curl.yaml has no package.epoch (ERROR)
2024/09/12 09:48:55 ERRO linting failed

Or missing parameters to pipelines:

wolfictl lint py3-cython.yaml
2024/09/12 09:53:54 INFO Package: py3-cython: [valid-pipeline-fetch-digest]: expected-sha256 or expected-sha512 is missing (ERROR)
2024/09/12 09:53:54 ERRO linting failed

It's hard to say where that line should be though reporting the line for the top of the package block doesn't seem unreasonable. Others though do have specific lines with errors that would be useful.

wolfictl lint curl.yaml
2024/09/12 09:51:09 INFO Package: curl: [bad-version]: invalid version 8.9.1asdfasdfas, could not parse (ERROR)
2024/09/12 09:51:09 ERRO linting failed
@justinvreeland justinvreeland added enhancement New feature or request needs-triage applied to all new customer/user issues. Removed after triage occurs. labels Sep 23, 2024
@sratslla
Copy link

sratslla commented Nov 2, 2024

Hey! I hope you are having a great day.

As I can see we need to make changes in Melange ReadAllPackagesFromRepo to store line numbers, Linter.Lint to include the line number in the lint message and Linter.Print to output the error with line numbers.

If I am correct I would like to contribute to Wolfi and make these changes :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs-triage applied to all new customer/user issues. Removed after triage occurs.
Projects
None yet
Development

No branches or pull requests

2 participants