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

Add "preserve" quote-style to mimic Black's skip-string-normalization #8822

Merged
merged 6 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,15 @@
'single1' "double2"
"double1" 'single2'
"double1" "double2"

def docstring_single_triple():
'''single triple'''

def docstring_double_triple():
"""double triple"""

def docstring_double():
"double triple"

def docstring_single():
'single'
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@ br"""br double triple"""
'single1' "double2"
"double1" 'single2'
"double1" "double2"

def docstring_single_triple():
'''single triple'''

def docstring_double_triple():
"""double triple"""

def docstring_double():
"double triple"

def docstring_single():
'single'
```

## Outputs
Expand Down Expand Up @@ -96,6 +108,22 @@ rb"""br double triple"""
'single1' 'double2'
'double1' 'single2'
'double1' 'double2'


def docstring_single_triple():
"""single triple"""


def docstring_double_triple():
"""double triple"""


def docstring_double():
"double triple"


def docstring_single():
"single"
```


Expand Down Expand Up @@ -150,6 +178,22 @@ rb"""br double triple"""
"single1" "double2"
"double1" "single2"
"double1" "double2"


def docstring_single_triple():
"""single triple"""


def docstring_double_triple():
"""double triple"""


def docstring_double():
"double triple"


def docstring_single():
"single"
```


Expand Down Expand Up @@ -204,6 +248,22 @@ rb"""br double triple"""
'single1' "double2"
"double1" 'single2'
"double1" "double2"


def docstring_single_triple():
"""single triple"""


def docstring_double_triple():
"""double triple"""


def docstring_double():
"double triple"


def docstring_single():
"single"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to clarify here (given what @charliermarsh said), we are starting with normalizing docstring using single quotes to double quotes (even with preserve=true)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, that's the current behavior of this PR. Like @charliermarsh this is probably unexpected behavior, but can be changed later if we hear feedback about it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM!

```


Expand Down
Loading