-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider relaxing the SPDX licenseInfoInFiles
check
#8052
Comments
I would like if there was a reporter option like |
Just to be sure we're on the same page. We're talking about strings which do not match the SPDX expression grammar, right? Like whether it should fail for any random string like e.g. "my random string"? |
My goal would be to accept any strings that from the pure grammar syntax represents a valid SPDX expression. I.e. "my random string" should not be valid, but "foo AND bar" should.
Edit: Scratch the above, it was an issue with Kotest not using up-to-code code in my test. So bottom line, I propose to replace |
I find it useful to let the user running ORT to make the choice. Therefore implementing this a configuration value (with lenient behavior as the default) would IMHO the best way to go |
Just a note on the implementation: The validation happens in the SPDX model, not in the reporter. So exposing the validation level as an SPDX reporter specific option requires some refactoring of the SPDX model first to make the validation configurable. |
Maybe something like https://github.com/nesk/akkurate could be used to first separate the SPDX validation from the |
Another alternative validation library is https://github.com/konform-kt/konform which is what ORT Server already uses. |
We currently do
ort/utils/spdx/src/main/kotlin/model/SpdxFile.kt
Lines 189 to 198 in 4629bd7
which results in the SPDX report not to be written out at all if a license is not an SPDX expression with non-deprecated SPDX IDs and / or
LicenseRef-
"exceptions". This can be problematic if e.g. a scanner emits deprecated SPDX IDs, or declared licenses contain some free text license name.My proposal is to not fail to write the report at all in this case, but just to log an error / warning in this case. This would allow the issue to become visible to the consumers of the SPDX report, instead of forcing them to get everything right even before the report gets written.
What do @mnonnenmacher and @fviernau think here?
The text was updated successfully, but these errors were encountered: