Repository navigation
google+numpydoc: stop customising via internals - #145
Merged
Merged
Conversation
`SectionSpec` covers what overriding a parser's internals was for, so those internals stop being a way to customise parsing: - Google's `titles_re` becomes private, and `_build_meta`, `_build_single_meta` and `_build_multi_meta` are folded into private methods and functions. - Numpydoc's `Section.title_pattern`, `Section.parse` and `KV_REGEX` become private, and `_parse_item` is no longer meant to be overridden. None of the 7 packages on PyPI known to use docstring_parser overrides any of them. Auto-detection no longer checks the Numpydoc sections for custom title patterns, and the tests that pinned overriding go; those for `title_colon=False` and custom `Section` objects stay. No output changes: `just parity` finds no difference.
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.
This PR stops treating parser internals as a way to customise parsing, now that
SectionSpeccovers it.titles_reis private, and_build_meta,_build_single_metaand_build_multi_metaare folded into private methods and functions.Section.title_pattern,Section.parseandKV_REGEXare private, and overriding_parse_itemis no longer supported.This is a breaking change. None of the 7 known PyPI users of docstring_parser overrides any of these. The README table maps each old way to its
SectionSpecreplacement.Auto-detection no longer checks Numpydoc sections for custom title patterns. The tests that pinned overriding are gone; the ones for
title_colon=Falseand customSectionobjects stay.No output change (
just parity), and speed matches main.