-
-
Notifications
You must be signed in to change notification settings - Fork 189
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
Linter: check the license_family is valid #339
Conversation
@@ -86,7 +88,13 @@ def lintify(meta, recipe_dir=None): | |||
if 'unknown' == license.strip(): | |||
lints.append('The recipe license cannot be unknown.') | |||
|
|||
# 6: Selectors should be in a tidy form. | |||
# 6: License family must be valid (conda-build checks for that) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know that we want to be messing with the ordering. Maybe @pelson can comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we want to keep the existing numbering, do you prefer adding the check to the end? Or making it 6b or such?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's go ahead and put it at the end. May need to rebase though as I just merged PR ( #334 ).
It's a bit redundant as |
I agree it's a redundant check, but it will be detected at lint rather than build time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once the number issue is addressed would be happy to merge.
377d920
to
fb5c3f6
Compare
@jakirkham done! |
license_family = about_section.get('license_family', '') | ||
if license_family and not license_family in allowed_license_families: | ||
lints.append('The recipe license_family `{}` is invalid: must be one of {}.' | ||
''.format(license_family, ', '.join(allowed_license_families))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually why don't we just use ensure_valid_license_family
to verify this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could do. I assume we want to catch the exception and add the message to lints
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's certainly an option and should be easy to do. 👍
@jakirkham now using |
Weird. 😕 Restarted and seems to have worked. However, there appears to be a merge conflict. Likely due to another linter change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Needs merge conflicts resolved. Then should be good to go.
0051878
to
26a3815
Compare
@jakirkham rebased on upstream master! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks!
conda-build actually checks for that. Relates to #88.