Fix static doc viewing in IDEs - #14195
Draft
larsoner wants to merge 5 commits into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The goals of this PR are to eventually:
docdictas the source of truth for multiple docstrings (good forblame, and existing workflows)docdictis modified, update all matches (preserve old dev behavior); but also add a new one: if a single matching docstring is modified, modifydocdictand all others (no longer have to opendocs.pyto edit a shared docstring, can edit inplace and have it propagate).# noqa: E501s are added/removed as needed (e.g., if thedocdictentry is unindented and runs to 87 char, the indented version will need the noqa line).fill_doc/verbose/copy_*_to_*as these are used in MNE-BIDS and MNE-Connectivity (and low cost to keep here)The diff looks scary, but of the ~1800 lines added only ~700 are the hook machinery, the rest is tests plus filled-in-docstring etc. This PR only implements these changes for a representative subset of docstrings that hopefully captures all of our
fill_doc/verboseuse cases. Assuming we're happy with the results, we can merge this, then I'll open a second PR that changes all docdict'ed docstrings to use this method (so that we can.git-blame-revs-ignoreit after it merges).These changes require some doc parsing logic, but it's not too bad. If we require that all these entries start on a given line at a given indentation level and don't decrease that level, it's doable. (There are some cases that are tough to disambiguate in the propagate-back-to-docdict case, and if it can't, then it will just raise an error and not try, similar to other pre-commit hooks when they cannot automatically fix things.)
Iterated multiple times through with Claude Fable 5. Changes understood by me. I plan to review more carefully in the coming days but wanted to get a WIP PR going in the meantime.
First part of two-part approach to #8218