-
Notifications
You must be signed in to change notification settings - Fork 7
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
fix: deduplicate entries in children and references #61
Conversation
docfx_yaml/extension.py
Outdated
# Checking in dictionary("{}") takes O(1) average time for a bit more space, | ||
# whereas checking in lists("[]") takes O(n) average time. |
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.
Not sure we need this, but it doesn't hurt. Using a dict as a set is standard.
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.
done.
docfx_yaml/extension.py
Outdated
@@ -626,6 +628,15 @@ def process_docstring(app, _type, name, obj, options, lines): | |||
""" | |||
This function takes the docstring and indexes it into memory. | |||
""" | |||
|
|||
# Check if we already processed this docstring. | |||
if name not in app.env.docfx_uid_names: |
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 would flip this, returning early if it's already processed. Then, you don't need the else
.
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.
done!
Thank you! Ready for review :) |
Before you open a pull request, note that this repository is forked from here.
Unless the issue you're trying to solve is unique to this specific repository,
please file an issue and/or send changes upstream to the original as well.
There was an issue with the way Sphinx imports docstrings, and processes certain items twice in
process_docstring
function. Instead of checking for duplicate entries in the children/reference, we'll check to see if we've already processed a docstring or not and solve it from the root cause.Fixes internally filed issue