-
Notifications
You must be signed in to change notification settings - Fork 73
♻️ split off source
fields in NeedItem
internal data
#1491
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
Conversation
The source mapping data (docname, lineno, ...) is now stored in a separate field, which allows for more clarity over the source of the need, allows more source specific information to be stored, and has better type safety. The users of these objects should see no change in its API
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1491 +/- ##
==========================================
+ Coverage 86.87% 88.82% +1.94%
==========================================
Files 56 68 +12
Lines 6532 8639 +2107
==========================================
+ Hits 5675 7674 +1999
- Misses 857 965 +108
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
need_type: str = "", | ||
title: str = "", |
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.
Why would the need_type have a default? Isn't that required primary information when using the API?
For the title I remember it can potentially be generated from other sources.
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.
So this was only because the docname and lineno were already before these arguments, and I can't add defaults for these without adding defaults for the others. Otherwise I have to change the order and potentially break user code already using add_need as it currently is (if they are not using keyword arguments)
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.
Ok got it. I see in generate_need (which is called by add_need
), that the given need type is checked against the registered types and errors if it does not match, so I'm ok with that.
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 like the new need source implementation. It's the better structure to know where information comes from.
The source mapping data (docname, lineno, ...) is now stored in a separate field, which allows for more clarity over the source of the need, allows more source specific information to be stored, and has better type safety.
The users of these objects should see no change in its API