-
Notifications
You must be signed in to change notification settings - Fork 72
♻️ Improve validation and docs for needs_global_options
#1410
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
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1410 +/- ##
==========================================
+ Coverage 86.87% 88.54% +1.66%
==========================================
Files 56 60 +4
Lines 6532 7218 +686
==========================================
+ Hits 5675 6391 +716
+ Misses 857 827 -30
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Thanks for the PR. BTW: the way it works with the PR was how it was done releases ago. |
Ah good to know, so shouldn't break anything then 😅 |
@danwos is it me or do some of the docs examples make no sense: needs_global_options = {'status': ('closed', 'status.lower() in ["done", "resolved", "closed"]')} This could never take effect, because it is checking for an already set needs_global_options = {
'status': [
('fulfilled', 'status.lower() in ["done", "resolved", "closed"]', 'type=="req"'),
('done', 'status.lower() in ["done", "resolved", "closed"]', 'type=="task"'),
('implemented', 'status.lower() in ["done", "resolved", "closed"]', 'type=="spec"')
]
} Same as above, but also: for (value, predicate, default) in list:
if predicate(item):
field = value
else:
field = default so this means only the final |
needs_global_options
keysneeds_global_options
@danwos Before this change, I was also using
However, Thank you for your help. |
As discussed in #1409,
needs_global_options
has overlapping functionality withneeds_extra_options
.It makes more sense that
needs_global_options
is only used to define defaults for fields,whereas
needs_extra_options
is for specifying new fields.This PR restricts the keys allowed to:
needs_extra_options
itemneeds_extra_links
itemlayout
status
style
tags
constraints
This means that projects with unknown keys will need to add them to
needs_extra_options
, e.g.default values are also properly type checked and, for delimited string lists, converted to lists of strings.