zarf-dev / zarf

DevSecOps for Air Gap & Limited-Connection Systems. https://zarf.dev/
Apache License 2.0
1.34k stars 162 forks source link

refactor: move finding table printing to CLI #2960

Closed phillebaba closed 1 week ago

phillebaba commented 1 week ago

Description

This change moves printing of the findings table from linting to the CLI rather than in the pkg code.

Related Issue

Relates to #2576

Checklist before merging

netlify[bot] commented 1 week ago

Deploy Preview for zarf-docs canceled.

Name Link
Latest commit 37ebe1c0eedd5ec9263fe00fa6f12257d2bd9130
Latest deploy log https://app.netlify.com/sites/zarf-docs/deploys/66d7277efda2620007a90309
phillebaba commented 1 week ago

I have removed the severity filter because I do not think it is being used. When calling lint.ValidatePackageSchema all findings will have the severity error.

Additionally we should start returning an exit code 1 for linter warnings. It should be up to the user to explicitly ignore this if they do not want to.

codecov[bot] commented 1 week ago

Codecov Report

Attention: Patch coverage is 18.84058% with 56 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/cmd/common/table.go 0.00% 27 Missing :warning:
src/cmd/dev.go 0.00% 19 Missing :warning:
src/cmd/package.go 0.00% 5 Missing :warning:
src/pkg/lint/lint.go 63.63% 4 Missing :warning:
src/pkg/lint/findings.go 0.00% 1 Missing :warning:
Files with missing lines Coverage Δ
src/pkg/message/message.go 10.07% <ø> (+0.30%) :arrow_up:
src/pkg/packager/creator/utils.go 25.00% <100.00%> (+5.00%) :arrow_up:
src/pkg/lint/findings.go 71.42% <0.00%> (+36.01%) :arrow_up:
src/pkg/lint/lint.go 45.67% <63.63%> (+5.67%) :arrow_up:
src/cmd/package.go 0.00% <0.00%> (ø)
src/cmd/dev.go 0.00% <0.00%> (ø)
src/cmd/common/table.go 0.00% <0.00%> (ø)