spdx / tools-java

SPDX Command Line Tools using the Spdx-Java-Library
Apache License 2.0
61 stars 37 forks source link

Validate: Deprecated license ID's should not show a document as invalid #123

Closed goneall closed 1 year ago

goneall commented 1 year ago

Currently, when a document contains an SPDX License ID marked as deprecated, it states "Invalid SPDX Document".

From the License List Documentation:

"When a license identifier is "deprecated" on the SPDX License List, it effectively means that there is an updated license identifier and the deprecated license identifier, while remaining valid, should no longer be used. "

If a document only contains validation messages due to deprecated license ID's, it should display a warning rather than invalid.

goneall commented 1 year ago

Propose the following text if only deprecated license ID's are found (an no other validation errors):

Document is valid, however, the following deprecated license ID's were found. References to the deprecated license ID's should be replaced.

@rnjudge @swinslow @jlovejoy - Let mw know your thoughts on the proposal.

rnjudge commented 1 year ago

@goneall right now, the tool groups the deprecated licenses it finds like so:

This SPDX Document is not valid due to:
                Package at line 34690 invalid: LGPL-2.1 is deprecated. in libseccomp2
                Package at line 8056 invalid: LGPL-2.1 is deprecated. in gcc-9-base

I would suggest grouping the warning separate from the sentence that the SPDX document is valid. Something like below?


Warning: Deprecated license identifiers were found that should no longer be used. References to the
following deprecated license ID's should be updated.
                Package at line 34690: LGPL-2.1 is deprecated. in libseccomp2
                Package at line 8056: LGPL-2.1 is deprecated. in gcc-9-base

This SPDX document is valid.
goneall commented 1 year ago

Thanks @rnjudge - I agree with your suggestion. It may take me a couple weeks to get to it, but I'll create a PR to implement.