-
Notifications
You must be signed in to change notification settings - Fork 23
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
Add relaxed
option to allow invalid licenses and exception names
#16
base: main
Are you sure you want to change the base?
Conversation
The code changes look good at first glance! I wonder a bit about whether this is a good idea, though. Or whether it should be a separate package, since this one is very clearly an implementation of standard SPDX. The expression grammar expressly applies to the defined license and exception lists. We have those lists as independent npm Is there a use case for this kind of relaxed parsing, other than allowing license identifiers that should not be allowed? |
I have written this patch only because I like this proposal and it was pretty easy to implement. I don't have any other use cases in mind and I don't need this relaxed mode. Do what you want, you are the judge ⚖️. |
Note this Python repository supports “relaxed parsing” and many other features and they are working on transpiling it to JS. I don't think it can entirely replace |
We're a team now. Your thoughts count as much as mine. Or more, since you've done so much work lately! There is more interest in this than I'd remembered. I definitely don't want to stand in the way. |
Sorry for the delay. I was quite busy lately. I thought about this yesterday. Since strictness widely varies We could get these features:
The linter might possibly lay in a separated repository. I will write a prototype soon. Any thoughts? |
Hmm. I should think about this a bit more---it's quite late here now. My first impression is that I wouldn't take too much from other parsers. Best case, the standard would be clear, and this implementation would be Correct. The grammar we're talking about is also relatively simple. It should work for its specific purpose, and not reinforce or encourage more variation. We don't want to further dilute the standard. |
in the current state you get this output parse('MIT OR Commercial', {relaxed: true})
{
left: {license: 'MIT'},
conjunction: 'or',
right: {license: 'Commercial'}
} I feel like it may be helpful to signal that this is not in the spdx license list parse('MIT OR Commercial', {relaxed: true})
{
left: {license: 'MIT'},
conjunction: 'or',
right: {noassertion: 'Commercial'}
} thoughts? |
ce3167f
to
19f25b5
Compare
Fix #11.