Skip to content
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 docstring re-indentation handling #1623

Merged
merged 1 commit into from
Aug 25, 2020
Merged

Conversation

ambv
Copy link
Collaborator

@ambv ambv commented Aug 25, 2020

This addresses a few crashers, namely:

  • producing non-equivalent code due to mangling escaped newlines,

  • invalid hugging quote characters in the docstring body to the docstring outer triple quotes (causing a quadruple quote which is a syntax error),

  • lack of handling for docstrings that start on the same line as the def, and

  • invalid stripping of outer triple quotes when the docstring contained a string prefix.

As a bonus, tests now also run when string normalization is disabled.

This addresses a few crashers, namely:

* producing non-equivalent code due to mangling escaped newlines,

* invalid hugging quote characters in the docstring body to the docstring outer
  triple quotes (causing a quadruple quote which is a syntax error),

* lack of handling for docstrings that start on the same line as the `def`, and

* invalid stripping of outer triple quotes when the docstring contained
  a string prefix.

As a bonus, tests now also run when string normalization is disabled.
@ichard26
Copy link
Collaborator

invalid hugging quote characters in the docstring body to the docstring outer triple quotes (causing a quadruple quote which is a syntax error),

So effectively #1455 is superseded and should be closed once this is merged. I'm not missing something here, right?

@ambv
Copy link
Collaborator Author

ambv commented Aug 25, 2020

Right, @ichard26.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants