wolfi-dev / wolfi-dev/wolfictl

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

Open
#1,203 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement needs-triage
Dominant language
Go
Stars
73
Forks
86
Avg merge
7d 7h
Merged PRs (30d)
15

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the wolfictl lint command using the curl.yaml and py3-cython.yaml examples, then inspect how lint diagnostics are reported. Done means diagnostics with specific errors include their line numbers, while diagnostics without one use the top of the relevant package block so editor integrations can consume them.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.