-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
F: stringsRelated to our handling of stringsRelated to our handling of stringsT: bugSomething isn't workingSomething isn't working
Description
Describe the bug A clear and concise description of what the bug is.
Black changes docstring quotes from ''' to """ for multiline docstrings when using --skip-string-normalization
To Reproduce Steps to reproduce the behavior:
- Take this file:
def a():
'''The function a'''
return 'a'
def b():
'''
The function b requires more words in the docstring
and as such uses a slightly different format.
'''
return 'b'
def c():
'''The function c requires more words in the docstring
but lines are expensive.'''
return 'c'
def d():
'''
The function d requires more words in the docstring
and does not know how to be consistent.'''
return 'd'
def e():
'''The function e requires more words in the docstring
and is confused by d.
'''
return 'e'
- Run Black on it with these arguments '--skip-string-normalization'
- The file is changed to this:
def a():
'''The function a'''
return 'a'
def b():
"""
The function b requires more words in the docstring
and as such uses a slightly different format.
"""
return 'b'
def c():
"""The function c requires more words in the docstring
but lines are expensive."""
return 'c'
def d():
"""
The function d requires more words in the docstring
and does not know how to be consistent."""
return 'd'
def e():
"""The function e requires more words in the docstring
and is confused by d.
"""
return 'e'
Expected behavior A clear and concise description of what you expected to happen.
Without string normalization the file should not have changed.
Environment (please complete the following information):
- Version:
black, version 20.8b1 - OS and Python version:
macOS 10.15.7 (19H2),Python 3.8.5
Does this bug also happen on master? To answer this, you have two options:
Additional context Add any other context about the problem here.
tomage and shatil
Metadata
Metadata
Assignees
Labels
F: stringsRelated to our handling of stringsRelated to our handling of stringsT: bugSomething isn't workingSomething isn't working