tools-golang icon indicating copy to clipboard operation
tools-golang copied to clipboard

Tag Value output sorts some elements by SPDXID

Open kzantow opened this issue 1 year ago • 1 comments

When outputting Tag Value format, some elements like Files are being sorted before being output, and these seem to be sorted by SPDXID. This causes a bit of a stability issue that a subsequent run, if an SPDXID is not stable (e.g. someone generating a UUID or other type of hashing function), elements are reordered in unexpected ways.

I believe these elements should be sorted by some type of primary field (like a file name) and subsequently by SPDXID for duplicates.

kzantow avatar Apr 27 '23 19:04 kzantow

hmmm, order shouldn't matter in spec, so this would be more for convenience.. but yea i think if its more convenient to have a bit more consistency, dont see why not... however, this could lead to the output document not being reproducible (unless we take the ordering of names followed by SPDX ID if tied).

Besides the reproducibility, i have no issue with changing the order.

lumjjb avatar Apr 27 '23 22:04 lumjjb