feat: Allow specific versions of formats to be specified (#1543)

This commit is contained in:
Keith Zantow
2023-02-07 10:40:43 -05:00
committed by GitHub
parent 95201840d2
commit 9650473298
26 changed files with 349 additions and 187 deletions
+4 -4
View File
@@ -7,7 +7,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/anchore/syft/syft"
"github.com/anchore/syft/syft/formats"
"github.com/anchore/syft/syft/formats/template"
)
@@ -21,9 +21,9 @@ func TestAllFormatsExpressible(t *testing.T) {
},
assertSuccessfulReturnCode,
}
formats := syft.FormatIDs()
require.NotEmpty(t, formats)
for _, o := range formats {
formatNames := formats.AllIDs()
require.NotEmpty(t, formatNames)
for _, o := range formatNames {
t.Run(fmt.Sprintf("format:%s", o), func(t *testing.T) {
args := []string{"dir:./test-fixtures/image-pkg-coverage", "-o", string(o)}
if o == template.ID {