-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
How to handle sphinx nitpicky mode #15042
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
Comments
I'm putting together a PR now which just strips out the part where we verify that references are still missing – that should reduce/remove? race conditions, at the expense of being too-permissive, but I think that's a good tradeoff to have. |
Scrolling through the json file, it looks like some of them are clearly incorrect use of single backtick (of which I am responsible for a fair number of coming into the code base...), some are modules being picked up as objects, and some are objects that are missing the correct scoping. We need to understand https://www.sphinx-doc.org/en/1.5/domains.html#cross-referencing-python-objects and in particular the heuristics around:
and demonstrate how to fix a few of them. We are planning a sprint/hackathon in NYC for the fall that this may be a good burn-down list of tasks for first time contributors. |
I skimmed through the file, a lot of them are
That should already cover quite a few entries. |
So what am I doing wrong in #14917? |
One issue with the line numbers is if code is added or removed above the error I think we will need to update the json file which is not great.... |
I found that I now get lots of warnings about references already being fixed when building the docs locally with sphinx 1.8.5, sphinx_gallery 0.5.0dev from the current matplotlib master. This could mean that sphinx_gallery is responsible for some breakages and fixed them in the meantime. |
If I am understanding how this works correctly, we can only ignore the a given (domain, key) globally, but we are doing the book keeping at the line level. When we fix a key, we should do a grep on the hole code base to find all instances of it (or just read the list of locations from the json). That is believable that sphinx gallery, I am definitely in favor of #15043 if that is the case. |
Actually it could also be a bug (or misuse from my side?) in the
saying
|
#15048 would fix the error. All the warnings however stay. And they are not related to the sphinx_gallery version. (I tested with sphinx_gallery 0.4.0 now and they persists.) |
I would like to investigate these errors more – unfortunately, I am away from a reliable internet until next weekend, so I can't take a serious look until then... |
I am going to close this, master branch has been mostly non-broken and I think we have a decent understanding of what these problems are (and there have been some PRs to start fixing them). |
@ImportanceOfBeingErnest
In general, however, I have some problems with this nitpicky stuff.
So is anyone actually optimistic this can be solved anytime soon? If not, I would propose to disable nitpicky for now.
Originally posted by @ImportanceOfBeingErnest in #15034 (comment)
@alexrudy
@ImportanceOfBeingErnest I think you are right, but I would propose something slightly different:
The line number bit was suggested by @anntzer in the original PR. I propose we remove the warnings about unused nitpick ignores by line number – but otherwise leave nitpick turned on.
This will still prevent the addition of "new" incorrect references, but allow any existing missing references to persist. The disadvantage is that it will allow "old" missing reference ignores to persist as well.
The text was updated successfully, but these errors were encountered: