enterprise-contract / ec-cli

Enterprise Contract command line interface
https://enterprisecontract.dev/docs/ec-cli/main/index.html
Apache License 2.0
27 stars 29 forks source link

Don't wrap image ref in text output #1663

Closed simonbaird closed 4 months ago

simonbaird commented 4 months ago

The wrapping only wraps on whitespace, so before this patch we'd end up with output like this for long image refs, which IMO looks untidy. Let's just have an over-long line rather than wrapping it like that.

› [Warning] cve.unpatched_cve_warnings
  ImageRef:
  quay.io/redhat-user-workloads/somelong-app-name/some-long-component-name@etc...

With the agressive space eating done by -}} and {{- it's easier to keep using the indentWrap helper func rather than try to add the two space indent some other way.

This is a followup tweak for the functionality introduced in #1656.

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.

Project coverage is 86.64%. Comparing base (2b77bfe) to head (faba907).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/enterprise-contract/ec-cli/pull/1663/graphs/tree.svg?width=650&height=150&src=pr&token=CY5ORXJB33&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=enterprise-contract)](https://app.codecov.io/gh/enterprise-contract/ec-cli/pull/1663?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=enterprise-contract) ```diff @@ Coverage Diff @@ ## main #1663 +/- ## ========================================== + Coverage 80.04% 86.64% +6.60% ========================================== Files 65 76 +11 Lines 4810 5153 +343 ========================================== + Hits 3850 4465 +615 + Misses 960 688 -272 ``` | [Flag](https://app.codecov.io/gh/enterprise-contract/ec-cli/pull/1663/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=enterprise-contract) | Coverage Δ | | |---|---|---| | [acceptance](https://app.codecov.io/gh/enterprise-contract/ec-cli/pull/1663/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=enterprise-contract) | `71.84% <0.00%> (?)` | | | [generative](https://app.codecov.io/gh/enterprise-contract/ec-cli/pull/1663/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=enterprise-contract) | `79.99% <0.00%> (-0.05%)` | :arrow_down: | | [integration](https://app.codecov.io/gh/enterprise-contract/ec-cli/pull/1663/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=enterprise-contract) | `79.99% <0.00%> (-0.05%)` | :arrow_down: | | [unit](https://app.codecov.io/gh/enterprise-contract/ec-cli/pull/1663/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=enterprise-contract) | `79.99% <0.00%> (-0.05%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=enterprise-contract#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/enterprise-contract/ec-cli/pull/1663?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=enterprise-contract) | Coverage Δ | | |---|---|---| | [internal/utils/templates.go](https://app.codecov.io/gh/enterprise-contract/ec-cli/pull/1663?src=pr&el=tree&filepath=internal%2Futils%2Ftemplates.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=enterprise-contract#diff-aW50ZXJuYWwvdXRpbHMvdGVtcGxhdGVzLmdv) | `52.38% <0.00%> (-2.62%)` | :arrow_down: | ... and [41 files with indirect coverage changes](https://app.codecov.io/gh/enterprise-contract/ec-cli/pull/1663/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=enterprise-contract)
simonbaird commented 4 months ago

I'll merge this when/if it goes green, don't want to invest more review time since it's so trivial.