-
Notifications
You must be signed in to change notification settings - Fork 66
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
👌 Improve parsing of need option lists with dynamic functions #1272
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1272 +/- ##
==========================================
- Coverage 86.87% 86.74% -0.14%
==========================================
Files 56 60 +4
Lines 6532 6908 +376
==========================================
+ Hits 5675 5992 +317
- Misses 857 916 +59
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
Thanks for the fix, looks good in general, just minor remarks.
sphinx_needs/api/need.py
Outdated
# Check if tag is in needs_tags. If not raise an error. | ||
if needs_config.tags: | ||
for tag in tags: | ||
needs_tags = [tag["name"] for tag in needs_config.tags] |
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.
tag
collides with outer tag
variable (not a functional problem as this is like a lambda, however still fishy.
Another thing: needs_tags
is generated for every tag
in tags
, however is never modified, so you can move it above the for loop.
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.
fixed
(note I would also like to replace these exceptions with warnings, but that's another PR)
return [] | ||
|
||
if not isinstance(text, str): | ||
assert isinstance(text, list) and all( |
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 this assertion raises it means a programming error in SN, right?
If not, just wondering, this will hard stop the build, right?
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.
yes it should be a programming error, so should be picked up in the test suite if failing
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
For need directive options of the format e.g.
:tags: a,[[func()]],b
Consolidate into single conversion function and add unit test
fixes #1271