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

Actually disable docstring prefix normalization with -S + fix instability #3168

Merged
merged 4 commits into from Jul 14, 2022

Commits on Jul 14, 2022

  1. Copy the full SHA
    69d5766 View commit details
    Browse the repository at this point in the history
  2. Actually disable docstring prefix normalization with -S + fix instabi…

    …lity
    
    The former was a regression I introduced a long time ago. To avoid
    changing the stable style too much, the regression is only fixed if
    --preview is enabled
    
    *annoying enough, as we currently always enforce a second format pass if
    changes were made, there's no good way to prove the existence of the
    docstring quote normalization instability issue. For posterity, here's
    one failing example:
    
        --- source
        +++ first pass
        @@ -1,7 +1,7 @@
         def some_function(self):
        -    ''''<text here>
        +    """ '<text here>
    
             <text here, since without another non-empty line black is stable>
    
        -    '''
        +    """
             pass
        --- first pass
        +++ second pass
        @@ -1,7 +1,7 @@
         def some_function(self):
        -    """ '<text here>
        +    """'<text here>
    
             <text here, since without another non-empty line black is stable>
    
             """
             pass
    ichard26 committed Jul 14, 2022
    Copy the full SHA
    54a450d View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    39317cd View commit details
    Browse the repository at this point in the history
  4. Wrap comment that's too long

    ichard26 committed Jul 14, 2022
    Copy the full SHA
    f161fe6 View commit details
    Browse the repository at this point in the history