Skip to content

Avoid D301 autofix for u prefixed strings#8495

Merged
charliermarsh merged 1 commit intomainfrom
dhruv/d301
Nov 5, 2023
Merged

Avoid D301 autofix for u prefixed strings#8495
charliermarsh merged 1 commit intomainfrom
dhruv/d301

Conversation

@dhruvmanila
Copy link
Member

This PR avoids creating the fix for D301 if the string is prefixed with u i.e., it's a unicode string. The reason being that u and r cannot be used together as it's a syntax error.

Refer: #8402 (comment)

@dhruvmanila dhruvmanila added the bug Something isn't working label Nov 5, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Nov 5, 2023

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@charliermarsh
Copy link
Member

Seems reasonable, though better I think we could be to remove the u since it's unnecessary in Python 3 IIRC.

@charliermarsh charliermarsh merged commit b3c2935 into main Nov 5, 2023
@charliermarsh charliermarsh deleted the dhruv/d301 branch November 5, 2023 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants