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

Regression fix: leave R prefixes capitalization alone #2285

Merged
merged 2 commits into from Jun 9, 2021

Commits on Jun 4, 2021

  1. Regression fix: leave R prefixes capitalization alone

    `black.strings.get_string_prefix` used to lowercase the extracted
    prefix before returning it. This is wrong because 1) it ignores the
    fact we should leave R prefixes alone because of MagicPython, and 2)
    there is dedicated prefix casing handling code that fixes issue 1.
    `.lower` is too naive.
    
    This was originally fixed in 20.8b0, but was reintroduced since 21.4b0.
    
    I also added proper prefix normalization for docstrings by using the
    `black.strings.normalize_string_prefix` helper.
    
    Some more test strings were added to make sure strings with capitalized
    prefixes aren't treated differently (actually happened with my original
    patch, Jelle had to point it out to me).
    ichard26 committed Jun 4, 2021
    Copy the full SHA
    c2ce5cf View commit details
    Browse the repository at this point in the history

Commits on Jun 8, 2021

  1. Copy the full SHA
    04e3741 View commit details
    Browse the repository at this point in the history