-
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
✨ Allow configuring description of extra option #1338
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1338 +/- ##
==========================================
+ Coverage 86.87% 88.03% +1.15%
==========================================
Files 56 60 +4
Lines 6532 7086 +554
==========================================
+ Hits 5675 6238 +563
+ Misses 857 848 -9
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.
Looks great, just a hint for the docs
Currently, the value of all extra options is expected to be a string; other types are not supported in other aspects of sphinx-needs, such as `needextend` and dynamic functions. This PR adds the `needs. mistyped_external_values ` and `needs.mistyped_import_values` warnings for non-string values, for `needs_external_needs` and `needimport` sources respectively. The warning is only emitted once per source, to avoid creating too many warnings. Note, in the future it is likely that more types will be supported via configuration in `needs_extra_options` (see #1338)
Currently, the value of all extra options is expected to be a string; other types are not supported in various aspects of sphinx-needs (such as `needextend`, dynamic functions and filtering), and in-fact are already silently converted to strings during processing, see: https://github.com/useblocks/sphinx-needs/blob/92b47b129047df1b7aa9f40332d48deb369dc0c2/sphinx_needs/api/need.py#L791 This PR adds the `needs.mistyped_external_values ` and `needs.mistyped_import_values` warnings for non-string values, for `needs_external_needs` and `needimport` sources respectively. The warning is only emitted once per source, to avoid creating too many warnings. Note, in the future it is hoped that more types will be supported via configuration in `needs_extra_options` (see #1338)
This PR allows for using a dict to define a
needs_extra_options
item, that can have both aname
and (optional)description
key, e.g.:Note, I envisage this extended dict format eventually also supporting other settings such as a data type, default, and possibly also limiting the need types it applies to, e.g.
These though would require additional code changes