]> git.madduck.net Git - etc/vim.git/commit

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Regression fix: leave R prefixes capitalization alone (#2285)
authorRichard Si <63936253+ichard26@users.noreply.github.com>
Wed, 9 Jun 2021 00:46:09 +0000 (20:46 -0400)
committerGitHub <noreply@github.com>
Wed, 9 Jun 2021 00:46:09 +0000 (17:46 -0700)
commit00e7e12a3a412ea386806d5d4eeaed345e912940
tree14e93ded7c92645ee6343ac92da89b88703dfbce
parenta9eab85f226df3b3070aca122d089dbd62b42b9c
Regression fix: leave R prefixes capitalization alone (#2285)

`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).
CHANGES.md
src/black/linegen.py
src/black/strings.py
src/black/trans.py
tests/data/long_strings__regression.py
tests/data/string_prefixes.py