Skip to content
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 c.this_doc() check for needextend filters #1393

Merged
merged 9 commits into from
Feb 11, 2025

Conversation

chrisjsewell
Copy link
Member

@chrisjsewell chrisjsewell commented Jan 29, 2025

This allows for filtering of needs only in the same document as the needextend itself, e.g.

.. needextend:: c.this_doc() and status is None
   :status: open

Putting this under the c (for check) namespace allows for the possibility to add future special checks, without polluting the global namespace.

cc @arwedus

This allows for filtering of needs only in the same document as the `needextend` itself.
Copy link

codecov bot commented Jan 29, 2025

Codecov Report

Attention: Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 88.24%. Comparing base (4e10030) to head (5727e65).
Report is 109 commits behind head on master.

Files with missing lines Patch % Lines
sphinx_needs/filter_common.py 90.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1393      +/-   ##
==========================================
+ Coverage   86.87%   88.24%   +1.36%     
==========================================
  Files          56       60       +4     
  Lines        6532     7155     +623     
==========================================
+ Hits         5675     6314     +639     
+ Misses        857      841      -16     
Flag Coverage Δ
pytests 88.24% <90.00%> (+1.36%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ubmarco
Copy link
Member

ubmarco commented Feb 4, 2025

Test case would be nice to have.

@chrisjsewell chrisjsewell changed the title 👌 Add current_docname variable for needextend filters 👌 Add this_doc function for needextend filters Feb 11, 2025
@chrisjsewell chrisjsewell requested a review from ubmarco February 11, 2025 11:39
@chrisjsewell
Copy link
Member Author

Test case would be nice to have.

done

@chrisjsewell chrisjsewell changed the title 👌 Add this_doc function for needextend filters 👌 Add n.this_doc() function for needextend filters Feb 11, 2025
@chrisjsewell chrisjsewell changed the title 👌 Add n.this_doc() function for needextend filters 👌 Add c.this_doc() function for needextend filters Feb 11, 2025
@chrisjsewell chrisjsewell requested a review from ubmarco February 11, 2025 21:05
Copy link
Member

@ubmarco ubmarco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good change

@chrisjsewell chrisjsewell changed the title 👌 Add c.this_doc() function for needextend filters ✨ Add c.this_doc() function for needextend filters Feb 11, 2025
@chrisjsewell chrisjsewell changed the title ✨ Add c.this_doc() function for needextend filters ✨ Add c.this_doc() check for needextend filters Feb 11, 2025
@chrisjsewell chrisjsewell merged commit 702469b into master Feb 11, 2025
19 checks passed
@chrisjsewell chrisjsewell deleted the needextend-current-docname branch February 11, 2025 21:17
chrisjsewell added a commit that referenced this pull request Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants