Enhancement request: Preserve parentheses in a license expression defined in "License choices"
Problem
The DejaCode "License choices" model was originally constructed before the introduction of the WITH operator. In order to align with emerging SPDX standards, we deprecated licenses that were actually a compound of a standard license and an exception; for example, we deprecated gpl-2.0-classpath and introduced classpath-exception-2.0 and now favor gpl-2.0 WITH classpath-exception-2.0 over the simple gpl-2.0-classpath. Consequently, the license expression cddl-1.1 OR (gpl-2.0 WITH classpath-exception-2.0) is much preferred over the older cddl-1.1 or gpl-2.0-classpath. DejaCode generally handles that new convention, but the parentheses are ignored in the "License choices" table.
What are the benefits of the requested enhancement? Clarify and improve license choices in DejaCode.
Describe the solution you would like Preserve the license expression as entered with parentheses.
@DennisClark Could you clarify what you mean by "Preserve the license expression as entered with parentheses"?
I'm assuming you want to store the cddl-1.1 OR (gpl-2.0 WITH classpath-exception-2.0) value in the database and display this value including the parentheses in the admin UI.
Let me know about other locations where the parentheses should be "kept" or "displayed".
Both values for from_expression and to_expression are "cleaned" and "normalized" before saving to the database in https://github.com/aboutcode-org/dejacode/blob/main/license_library/forms.py#L74-L83
The parentheses are lost during this process because it is considered "redundant" by the license_expression library. Are we sure we want to make an exception for the license choice values and create inconsistency?
Perhaps this should wait until we implement the newer exception terminology.
We can postpone this one for now.