Merge pull request #59 from tarunsamanta2k20/tarunsamanta/#54

Added feature for showing Ecosystem name in the table along with othe…
This commit is contained in:
Abhisek Datta 2023-04-13 16:08:49 +05:30 committed by GitHub
commit 3ba2a456d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -234,23 +234,24 @@ func (r *summaryReporter) renderRemediationAdvice() {
fmt.Println(text.Bold.Sprint("Consider upgrading the following libraries for maximum impact:"))
fmt.Println()
tbl := table.NewWriter()
tbl.SetOutputMirror(os.Stdout)
tbl.SetStyle(table.StyleLight)
tbl.AppendHeader(table.Row{"Package", "Update To", "Impact"})
tbl.AppendHeader(table.Row{"Package", "Ecosystem", "Update To", "Impact"})
for idx, sp := range sortedPackages {
if idx >= summaryReportMaxUpgradeAdvice {
break
}
insight := utils.SafelyGetValue(sp.pkg.Insights)
tbl.AppendRow(table.Row{
r.packageNameForRemediationAdvice(sp.pkg),
sp.pkg.Manifest.Ecosystem,
utils.SafelyGetValue(insight.PackageCurrentVersion),
sp.score,
})
tagText := ""