Repository navigation
docstring_parser: normalise whitespace in types - #190
Merged
Merged
Conversation
A type kept the spaces, tabs and newlines it was written with, so a type wrapped over two lines held a newline. Each run of whitespace in a type is now one space, in every style, except in a part that quotes text. raw_type_name still holds the type as written.
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.
Covers item 8 from the BEHAVIOR.md review for #136: "The remaining parts make up
type_name, with whitespace normalized".A type used to keep the spaces, tabs and newlines it was written with, so
list of str, or a ReST:type:wrapped over two lines, gave atype_namewith runs of spaces or a newline in it. In every style, each run of whitespace in a type is now one space. A part that quotes text, such asLiteral["a b"], keeps its spaces.raw_type_namestill holds the type as written.Case diffs: two Twisted corpus files whose Epydoc
@typewraps over two lines:twisted.mail.tap.Options._getEndpointstwisted.trial.reporter.TestResult.addUnexpectedSuccessParity against origin/main: 1037 of 29184 docstrings differ (case 2, stdlib 0, the rest generated). The generated ones are mixed inputs whose types swallowed a following line. Those types are now joined with a space instead of a newline.