-
-
Notifications
You must be signed in to change notification settings - Fork 162
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
improve section detection #327
base: main
Are you sure you want to change the base?
Conversation
yielding numpydoc/numpydoc/docscrape.py Lines 214 to 219 in 265ab91
because it will cause this to fail with a obscure error: numpydoc/numpydoc/docscrape.py Lines 380 to 381 in 265ab91
I think this should be fixed, either by changing the yield value to |
Ping. Does anyone have any comments on this? |
I think the discussion in gh-316 shows this is not desirable. Detecting in order to raise a better warning or even an exception makes sense though. |
apologies for pinging and then forgetting about it for a year. I implemented the requested change, such that it will now warn on every missing empty line (between summary and the first section, or between two sections). The current implementation comes with a (slight?) performance regression because Instead, I could also imagine doing a two-pass implementation: find all separators (multiple Edit: I think the CI failures are unrelated (not sure, though) |
Potentially fixes #316.
This tries to allow parsing sections which are not separated by blank lines (there should probably be a warning in that case, I'll add that once the general idea has been approved). In order to get that to work used a few tricks (e.g. add a optional
doc
parameter to_is_at_section
to allow calling it on a different reader) so it might need some refactoring before being truly ready.cc @Carreau, my main motivation was trying to get
velin
to auto-fix this