-
Notifications
You must be signed in to change notification settings - Fork 84
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
Add internal link checking to sphinx-build #1827
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #1827 +/- ##
=======================================
Coverage 92.18% 92.19%
=======================================
Files 27 27
Lines 2637 2639 +2
Branches 689 690 +1
=======================================
+ Hits 2431 2433 +2
Misses 136 136
Partials 70 70
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
I think that's fine. |
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 all these fixes. Aside from the issue with the mpi Intracom in docval this looks good to me.
That's a lot of fixes! Thank you. |
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 looks all good to me. I would wait for @rly to approve as well, but I believe I need to approve too since I requested changes earlier.
did we want to raise nitpicky warnings as errors in the workflow here too? |
Yes, that would be great. It's too bad that the type hint for |
Looks good to me. To be clear, the remaining warning will be fixed in the next release of HDMF, right?
|
If so, let's hold off on merging until that's released. |
Yes the remaining warnings should be fixed in the next release of HDMF. Right now it's stopping at the first warning (there are a lot more). If we want to show the rest of the errors in the workflow run we could add the --keep-going flag. |
@stephprince It looks like there is a new failure in the build - could you please look into it today if you can? If not, let me know and I'll try. I would like this in the next pynwb release today/tomorrow. |
Motivation
Fix #1731.
Running sphinx-build in nitpicky mode can be used to check internal links. This PR will update the GitHub workflow / Makefile to use nitpicky mode and fix broken links/references.
A couple of notes
Fixing all internal links will also require updates to hdmf (See related PR Fix internal links in docs hdmf-dev/hdmf#1031)
Running sphinx-build in nitpicky mode will generate warnings by default. If we want to be stricter, we can add the
-W
flag to generate errors for broken internal linkscolons in docstrings get picked up by sphinx as references due to the sphinx Napoleon extension (See issue here). For now, I replaced colons with dashes, but there are a couple options for getting colons to work if it's preferred to keep them. See the image below for examples of what they might look like:
Using type hints with h5py data types causes internal reference warnings. I couldn't figure out the best way to approach fixing that currently. It only happened in the
get_nwbfile_version
function so I switched it to usedocval
insteadHow to test the behavior?
Checklist
flake8
from the source directory.