-
Notifications
You must be signed in to change notification settings - Fork 71
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
exclude needs under only directive if required #1106
exclude needs under only directive if required #1106
Conversation
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.
Please see also my comment in the related issue: #1103 (comment)
sphinx_needs/directives/need.py
Outdated
@@ -356,6 +359,16 @@ def previous_sibling(node: nodes.Node) -> Optional[nodes.Node]: | |||
return node.parent[i - 1] if i > 0 else None # type: ignore | |||
|
|||
|
|||
def need_node_excluded_by_only_directive(env: BuildEnvironment, node: nodes.Node) -> bool: | |||
"""Return True if the node is under an "only" directive that shall be excluded given to the current tags""" | |||
if hasattr(node.parent, "tagname") and node.parent.tagname == "only": |
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 guess this would not support nested needs or needs in other directives like container
, list-table
and co.
cf51427
to
7afd6ea
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1106 +/- ##
==========================================
+ Coverage 83.83% 83.87% +0.03%
==========================================
Files 56 56
Lines 6429 6442 +13
==========================================
+ Hits 5390 5403 +13
Misses 1039 1039
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
fd3343b
to
7d783c0
Compare
7d783c0
to
eda2264
Compare
Covered by #1112 |
fix for #1103