-
Notifications
You must be signed in to change notification settings - Fork 72
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
#947 filter_warning option to replace default "No needs passed the filters" text #1093
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1093 +/- ##
==========================================
+ Coverage 79.27% 83.19% +3.92%
==========================================
Files 56 56
Lines 6460 6456 -4
==========================================
+ Hits 5121 5371 +250
+ Misses 1339 1085 -254
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 PR. 👍
Technical realization looks good.
I think the dictionary operations can be shortened. I left 1-2 comments, but it affects all changes for the different directives.
content.append(no_needs_found_paragraph()) | ||
content.append( | ||
no_needs_found_paragraph( | ||
current_needextract["filter_warning"] if "filter_warning" in current_needextract else None |
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 can be shorten to:
current_needextrac.get("filter_warning", None)
@@ -228,7 +228,11 @@ def process_needfilters( | |||
content.append(puml_node) | |||
|
|||
if len(content) == 0: | |||
nothing_found = "No needs passed the filters" | |||
nothing_found = ( |
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.
This we could write like
nothing_found = current_needfilter.get('filter_warning', 'No needs passed the filters')
|
||
.. needtable:: | ||
:filter: ("7" in tags) | ||
:filter_warning: |
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.
Would add here a positive filter result as well, to be sure the text is not printed if needs got found.
Hi! Just your suggestions will be integrated cause they provide for sure a more pythonic solution.
|
Regarding the linter problem, this may happen if mypy or other linter-libs got an update and introduced new checks. However, you can deactivate the specific test in [[tool.mypy.overrides]]
module = [
"sphinx_needs.directives.needextract",
]
disable_error_code = "no-untyped-call" Regarding Thanks for the invested time!! 🙏 |
So, made some fixes:
Changed behaviour:
Added more tests, including a good case there needs are found and filtered message should not be shown. |
The checks failed due to upload error to codecov... |
Just one more questions: The error message shown is
Is there a specific problem with the pyvenv/nox or what could get wrong? |
Cypress is our frontend JavaScript test framework, to test browser based features like the need-collapse button. I guess there is a flag for all frontend tests, so it could be deactivate with the right pytest command. |
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.
Looks good. Thanks for the update and the good tests.
I will work a little bit on the docs and merge it then (hopefully today)
Hi! After some time 2 thinks were upcomming:
|
With the latest commit i think everything is now successfully finished. If you have no more comments/issues with the PR, i think it is ready to get merged 😄 |
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.
Looks good, thanks a lot for the PR 👍
Add option
:filter_warning:
to directives (e.g. needtable) to show no text or given text instead of the default text.