From bf567cc00a8ce50d63db416ea459898ecd5d6cb0 Mon Sep 17 00:00:00 2001 From: Mark Bell Date: Fri, 2 Oct 2020 23:35:45 +0100 Subject: [PATCH 01/14] Now strip leading and trailing whitespace from single line docstrings. --- src/black/__init__.py | 15 +++++++-------- tests/data/docstring.py | 8 +++++++- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/black/__init__.py b/src/black/__init__.py index 24e9d4edaaa..05f1c8deeef 100644 --- a/src/black/__init__.py +++ b/src/black/__init__.py @@ -2060,8 +2060,12 @@ def visit_STRING(self, leaf: Leaf) -> Iterator[Line]: prefix = get_string_prefix(leaf.value) lead_len = len(prefix) + 3 tail_len = -3 - indent = " " * 4 * self.current_line.depth - docstring = fix_docstring(leaf.value[lead_len:tail_len], indent) + docstring = leaf.value[lead_len:tail_len] + if is_multiline_string(leaf): + indent = " " * 4 * self.current_line.depth + docstring = fix_docstring(docstring, indent) + else: + docstring = docstring.strip() if docstring: if leaf.value[lead_len - 1] == docstring[0]: docstring = " " + docstring @@ -5917,7 +5921,7 @@ def get_imports_from_children(children: List[LN]) -> Generator[str, None, None]: @lru_cache() def get_gitignore(root: Path) -> PathSpec: - """ Return a PathSpec matching gitignore content if present.""" + """Return a PathSpec matching gitignore content if present.""" gitignore = root / ".gitignore" lines: List[str] = [] if gitignore.is_file(): @@ -6711,11 +6715,6 @@ def patched_main() -> None: def is_docstring(leaf: Leaf) -> bool: - if not is_multiline_string(leaf): - # For the purposes of docstring re-indentation, we don't need to do anything - # with single-line docstrings. - return False - if prev_siblings_are( leaf.parent, [None, token.NEWLINE, token.INDENT, syms.simple_stmt] ): diff --git a/tests/data/docstring.py b/tests/data/docstring.py index 2d3d73a101c..848256a2edf 100644 --- a/tests/data/docstring.py +++ b/tests/data/docstring.py @@ -110,6 +110,9 @@ def ignored_docstring(): """a => \ b""" +def single_line_docstring_with_whitespace(): + """ This should be stripped """ + # output class MyClass: @@ -222,4 +225,7 @@ def believe_it_or_not_this_is_in_the_py_stdlib(): def ignored_docstring(): """a => \ -b""" \ No newline at end of file +b""" + +def single_line_docstring_with_whitespace(): + """This should be stripped""" From c7d35fee632ad1016bc3c97670e2a2ebfac3ad0d Mon Sep 17 00:00:00 2001 From: Mark Bell Date: Fri, 2 Oct 2020 23:41:44 +0100 Subject: [PATCH 02/14] Fixed number of blank lines required between functions. --- tests/data/docstring.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/data/docstring.py b/tests/data/docstring.py index 848256a2edf..dbc684d4a29 100644 --- a/tests/data/docstring.py +++ b/tests/data/docstring.py @@ -227,5 +227,6 @@ def ignored_docstring(): """a => \ b""" + def single_line_docstring_with_whitespace(): """This should be stripped""" From 133cb23a4e552a571f59b18daafe66ce6274bbf3 Mon Sep 17 00:00:00 2001 From: Mark Bell Date: Sat, 27 Mar 2021 14:40:25 +0000 Subject: [PATCH 03/14] Added description of PR #1740 --- CHANGES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 7da7be7b842..a25292b96ea 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,6 +4,8 @@ #### _Black_ +- `Black` now requires one-line docstrings to not have leading or trailing spaces (PR #1740) + - `Black` now respects `--skip-string-normalization` when normalizing multiline docstring quotes (#1637) From d53bfa939a73ed3e467ae99dcfcef57e12564351 Mon Sep 17 00:00:00 2001 From: Mark Bell Date: Sat, 27 Mar 2021 14:42:24 +0000 Subject: [PATCH 04/14] Black --- CHANGES.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index a25292b96ea..b7c5f62117a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,7 +4,8 @@ #### _Black_ -- `Black` now requires one-line docstrings to not have leading or trailing spaces (PR #1740) +- `Black` now requires one-line docstrings to not have leading or trailing spaces (PR + #1740) - `Black` now respects `--skip-string-normalization` when normalizing multiline docstring quotes (#1637) From d55cda679b144745a608af164447a2362e14e214 Mon Sep 17 00:00:00 2001 From: Mark Bell Date: Sat, 27 Mar 2021 14:43:27 +0000 Subject: [PATCH 05/14] Update CHANGES.md --- CHANGES.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index b7c5f62117a..62f2ea81fa6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,8 +4,8 @@ #### _Black_ -- `Black` now requires one-line docstrings to not have leading or trailing spaces (PR - #1740) +- `Black` now requires one-line docstrings to not have leading or trailing spaces + (PR #1740) - `Black` now respects `--skip-string-normalization` when normalizing multiline docstring quotes (#1637) From 1f7009c4605dba48ddfdd049eb2944c45f2328d1 Mon Sep 17 00:00:00 2001 From: Mark Bell Date: Sat, 27 Mar 2021 15:01:12 +0000 Subject: [PATCH 06/14] Rephrased PR description Rephrasing required while PR checks for CHANGES.md and Lint can contradict each other. Raised as issue 2070. --- CHANGES.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 62f2ea81fa6..804d6384075 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,8 +4,7 @@ #### _Black_ -- `Black` now requires one-line docstrings to not have leading or trailing spaces - (PR #1740) +- `Black` now requires one-line docstrings to be stripped (PR #1740) - `Black` now respects `--skip-string-normalization` when normalizing multiline docstring quotes (#1637) From 128f04ac8bd5bcbe5d9606b899bb1d663df882a4 Mon Sep 17 00:00:00 2001 From: Mark Bell Date: Mon, 12 Apr 2021 00:12:08 +0100 Subject: [PATCH 07/14] Update CHANGES.md Co-authored-by: Jelle Zijlstra --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 804d6384075..5b9ab61862d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,7 +4,7 @@ #### _Black_ -- `Black` now requires one-line docstrings to be stripped (PR #1740) +- `Black` now strips leading and trailing spaces from one-line docstrings (PR #1740) - `Black` now respects `--skip-string-normalization` when normalizing multiline docstring quotes (#1637) From 9717f4527015b4609d54f6f22635c5dec8c9fe35 Mon Sep 17 00:00:00 2001 From: Mark Bell Date: Mon, 12 Apr 2021 00:20:03 +0100 Subject: [PATCH 08/14] Fixed how PR is referenced. --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 615eada8ca5..9ec80fca509 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,7 +4,7 @@ #### _Black_ -- `Black` now strips leading and trailing spaces from one-line docstrings (PR #1740) +- `Black` now strips leading and trailing spaces from one-line docstrings (#1740) - `Black` now cleans up leading non-breaking spaces in comments (#2092) From b4c2985ba429163735b10ac781f13dd8995fa969 Mon Sep 17 00:00:00 2001 From: Mark Bell Date: Mon, 12 Apr 2021 00:30:36 +0100 Subject: [PATCH 09/14] Empty docstrings are mapped to a single space. --- src/black/__init__.py | 2 ++ tests/data/docstring.py | 23 ++++++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/black/__init__.py b/src/black/__init__.py index e74b1067226..f7eee2bcf44 100644 --- a/src/black/__init__.py +++ b/src/black/__init__.py @@ -2166,6 +2166,8 @@ def visit_STRING(self, leaf: Leaf) -> Iterator[Line]: docstring = " " + docstring if leaf.value[tail_len + 1] == docstring[-1]: docstring = docstring + " " + else: + docstring = " " leaf.value = leaf.value[0:lead_len] + docstring + leaf.value[tail_len:] yield from self.visit_default(leaf) diff --git a/tests/data/docstring.py b/tests/data/docstring.py index 0b6cb0be0f3..39a1e94dc54 100644 --- a/tests/data/docstring.py +++ b/tests/data/docstring.py @@ -102,6 +102,19 @@ def and_this(): "hey yah"''' +def empty(): + ''' + + + + + ''' + + +def oneline_empty(): + ''' ''' + + def believe_it_or_not_this_is_in_the_py_stdlib(): ''' "hey yah"''' @@ -242,6 +255,14 @@ def and_this(): "hey yah"''' +def empty(): + """ """ + + +def oneline_empty(): + """ """ + + def believe_it_or_not_this_is_in_the_py_stdlib(): ''' "hey yah"''' @@ -278,4 +299,4 @@ def docstring_with_inline_tabs_and_tab_indentation(): line ends with some tabs """ - pass \ No newline at end of file + pass From 9cddcbeea2bf84650de3a536fea4ab6cf48ba4e2 Mon Sep 17 00:00:00 2001 From: Mark Bell Date: Mon, 12 Apr 2021 00:45:31 +0100 Subject: [PATCH 10/14] Marked a number of packages as expecting formatting changes. --- src/black_primer/primer.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/black_primer/primer.json b/src/black_primer/primer.json index 32df01571a7..3a1fae090a0 100644 --- a/src/black_primer/primer.json +++ b/src/black_primer/primer.json @@ -3,7 +3,7 @@ "projects": { "aioexabgp": { "cli_arguments": [], - "expect_formatting_changes": false, + "expect_formatting_changes": true, "git_clone_url": "https://github.com/cooperlees/aioexabgp.git", "long_checkout": false, "py_versions": ["all"] @@ -17,7 +17,7 @@ }, "bandersnatch": { "cli_arguments": [], - "expect_formatting_changes": false, + "expect_formatting_changes": true, "git_clone_url": "https://github.com/pypa/bandersnatch.git", "long_checkout": false, "py_versions": ["all"] @@ -84,7 +84,7 @@ }, "ptr": { "cli_arguments": [], - "expect_formatting_changes": false, + "expect_formatting_changes": true, "git_clone_url": "https://github.com/facebookincubator/ptr.git", "long_checkout": false, "py_versions": ["all"] @@ -98,14 +98,14 @@ }, "sqlalchemy": { "cli_arguments": [], - "expect_formatting_changes": false, + "expect_formatting_changes": true, "git_clone_url": "https://github.com/sqlalchemy/sqlalchemy.git", "long_checkout": false, "py_versions": ["all"] }, "tox": { "cli_arguments": [], - "expect_formatting_changes": false, + "expect_formatting_changes": true, "git_clone_url": "https://github.com/tox-dev/tox.git", "long_checkout": false, "py_versions": ["all"] From 46d88459abcbb6a098c3a53889c6aaefd1129650 Mon Sep 17 00:00:00 2001 From: Mark Bell Date: Mon, 12 Apr 2021 01:52:11 +0100 Subject: [PATCH 11/14] Fixed incorrect handling of docstrings that were defined without triple quotes. --- src/black/__init__.py | 12 ++++++------ tests/data/docstring.py | 8 ++++++++ tests/data/function.py | 4 ++-- tests/data/function2.py | 2 +- tox.ini | 2 +- 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/black/__init__.py b/src/black/__init__.py index f7eee2bcf44..036ecef9618 100644 --- a/src/black/__init__.py +++ b/src/black/__init__.py @@ -2153,22 +2153,22 @@ def visit_STRING(self, leaf: Leaf) -> Iterator[Line]: # We're ignoring docstrings with backslash newline escapes because changing # indentation of those changes the AST representation of the code. prefix = get_string_prefix(leaf.value) - lead_len = len(prefix) + 3 - tail_len = -3 - docstring = leaf.value[lead_len:tail_len] + docstring = leaf.value[len(prefix) :] # Remove the prefix + quote_type = docstring[0] + docstring = docstring.strip(quote_type) # Remove outer quotes if is_multiline_string(leaf): indent = " " * 4 * self.current_line.depth docstring = fix_docstring(docstring, indent) else: docstring = docstring.strip() if docstring: - if leaf.value[lead_len - 1] == docstring[0]: + if docstring[0] == quote_type: docstring = " " + docstring - if leaf.value[tail_len + 1] == docstring[-1]: + if docstring[-1] == quote_type: docstring = docstring + " " else: docstring = " " - leaf.value = leaf.value[0:lead_len] + docstring + leaf.value[tail_len:] + leaf.value = prefix + quote_type * 3 + docstring + quote_type * 3 yield from self.visit_default(leaf) diff --git a/tests/data/docstring.py b/tests/data/docstring.py index 39a1e94dc54..598ccc064ce 100644 --- a/tests/data/docstring.py +++ b/tests/data/docstring.py @@ -115,6 +115,10 @@ def oneline_empty(): ''' ''' +def single_quotes(): + 'testing' + + def believe_it_or_not_this_is_in_the_py_stdlib(): ''' "hey yah"''' @@ -263,6 +267,10 @@ def oneline_empty(): """ """ +def single_quotes(): + """testing""" + + def believe_it_or_not_this_is_in_the_py_stdlib(): ''' "hey yah"''' diff --git a/tests/data/function.py b/tests/data/function.py index 2d642c8731b..443e2600d12 100644 --- a/tests/data/function.py +++ b/tests/data/function.py @@ -17,7 +17,7 @@ def func_no_args(): exec("new-style exec", {}, {}) return None async def coroutine(arg, exec=False): - "Single-line docstring. Multiline is harder to reformat." + 'Single-line docstring. Multiline is harder to reformat.' async with some_connection() as conn: await conn.do_what_i_mean('SELECT bobby, tables FROM xkcd', timeout=2) await asyncio.sleep(1) @@ -124,7 +124,7 @@ def func_no_args(): async def coroutine(arg, exec=False): - "Single-line docstring. Multiline is harder to reformat." + """Single-line docstring. Multiline is harder to reformat.""" async with some_connection() as conn: await conn.do_what_i_mean("SELECT bobby, tables FROM xkcd", timeout=2) await asyncio.sleep(1) diff --git a/tests/data/function2.py b/tests/data/function2.py index cfc259ea7bd..73d8c40b3ec 100644 --- a/tests/data/function2.py +++ b/tests/data/function2.py @@ -43,7 +43,7 @@ def f( def g(): - "Docstring." + """Docstring.""" def inner(): pass diff --git a/tox.ini b/tox.ini index 9bb809abe41..71b02e920c7 100644 --- a/tox.ini +++ b/tox.ini @@ -23,4 +23,4 @@ commands = pip install -e .[d] coverage erase coverage run fuzz.py - coverage report \ No newline at end of file + coverage report From 742dcae4dae42e29d5acc76564bae727a2aae03c Mon Sep 17 00:00:00 2001 From: Mark Bell Date: Mon, 12 Apr 2021 01:52:11 +0100 Subject: [PATCH 12/14] Fixed incorrect handling of docstrings that were defined without triple quotes. --- CHANGES.md | 4 +++- src/black/__init__.py | 21 +++++++++++++++------ tests/data/docstring.py | 8 ++++++++ tests/data/function.py | 4 ++-- tests/data/function2.py | 2 +- tox.ini | 2 +- 6 files changed, 30 insertions(+), 11 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 9ec80fca509..5016b36e565 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,7 +4,9 @@ #### _Black_ -- `Black` now strips leading and trailing spaces from one-line docstrings (#1740) +- `Black` now processes one-line docstrings by stripping leading and trailing spaces, + converting single quotes to triple quotes, and adding a padding space when the + docstring is empty or starts / ends with a quote. (#1740) - `Black` now cleans up leading non-breaking spaces in comments (#2092) diff --git a/src/black/__init__.py b/src/black/__init__.py index f7eee2bcf44..1b55b1d6e09 100644 --- a/src/black/__init__.py +++ b/src/black/__init__.py @@ -2153,22 +2153,31 @@ def visit_STRING(self, leaf: Leaf) -> Iterator[Line]: # We're ignoring docstrings with backslash newline escapes because changing # indentation of those changes the AST representation of the code. prefix = get_string_prefix(leaf.value) - lead_len = len(prefix) + 3 - tail_len = -3 - docstring = leaf.value[lead_len:tail_len] + docstring = leaf.value[len(prefix) :] # Remove the prefix + quote_type = docstring[0] + # A natural way to remove the outer quotes is to do: + # docstring = docstring.strip(quote_type) + # but that breaks on """""x""" (which is '""x') + # So we actually need to remove the first character and the next two + # characters but only if they are the same as the first. + docstring = re.sub(r"^(.)(\1\1)?", "", docstring) + # But it is always safe to remove all of them from the right. + docstring = docstring.rstrip(quote_type) if is_multiline_string(leaf): indent = " " * 4 * self.current_line.depth docstring = fix_docstring(docstring, indent) else: docstring = docstring.strip() if docstring: - if leaf.value[lead_len - 1] == docstring[0]: + # Add some padding if the docstring starts with a quote mark. + if docstring[0] == quote_type: docstring = " " + docstring - if leaf.value[tail_len + 1] == docstring[-1]: + if docstring[-1] == quote_type: docstring = docstring + " " else: + # Add some padding if the docstring is empty. docstring = " " - leaf.value = leaf.value[0:lead_len] + docstring + leaf.value[tail_len:] + leaf.value = prefix + quote_type * 3 + docstring + quote_type * 3 yield from self.visit_default(leaf) diff --git a/tests/data/docstring.py b/tests/data/docstring.py index 39a1e94dc54..598ccc064ce 100644 --- a/tests/data/docstring.py +++ b/tests/data/docstring.py @@ -115,6 +115,10 @@ def oneline_empty(): ''' ''' +def single_quotes(): + 'testing' + + def believe_it_or_not_this_is_in_the_py_stdlib(): ''' "hey yah"''' @@ -263,6 +267,10 @@ def oneline_empty(): """ """ +def single_quotes(): + """testing""" + + def believe_it_or_not_this_is_in_the_py_stdlib(): ''' "hey yah"''' diff --git a/tests/data/function.py b/tests/data/function.py index 2d642c8731b..443e2600d12 100644 --- a/tests/data/function.py +++ b/tests/data/function.py @@ -17,7 +17,7 @@ def func_no_args(): exec("new-style exec", {}, {}) return None async def coroutine(arg, exec=False): - "Single-line docstring. Multiline is harder to reformat." + 'Single-line docstring. Multiline is harder to reformat.' async with some_connection() as conn: await conn.do_what_i_mean('SELECT bobby, tables FROM xkcd', timeout=2) await asyncio.sleep(1) @@ -124,7 +124,7 @@ def func_no_args(): async def coroutine(arg, exec=False): - "Single-line docstring. Multiline is harder to reformat." + """Single-line docstring. Multiline is harder to reformat.""" async with some_connection() as conn: await conn.do_what_i_mean("SELECT bobby, tables FROM xkcd", timeout=2) await asyncio.sleep(1) diff --git a/tests/data/function2.py b/tests/data/function2.py index cfc259ea7bd..73d8c40b3ec 100644 --- a/tests/data/function2.py +++ b/tests/data/function2.py @@ -43,7 +43,7 @@ def f( def g(): - "Docstring." + """Docstring.""" def inner(): pass diff --git a/tox.ini b/tox.ini index 9bb809abe41..71b02e920c7 100644 --- a/tox.ini +++ b/tox.ini @@ -23,4 +23,4 @@ commands = pip install -e .[d] coverage erase coverage run fuzz.py - coverage report \ No newline at end of file + coverage report From 0e9c44fd0edd0c0c2b0697908416bd68b422ffbb Mon Sep 17 00:00:00 2001 From: Mark Bell Date: Mon, 12 Apr 2021 09:53:54 +0100 Subject: [PATCH 13/14] Preserve docstring quote length. --- CHANGES.md | 3 +-- src/black/__init__.py | 24 ++++++++++++++---------- tests/data/docstring.py | 2 +- tests/data/function.py | 2 +- tests/data/function2.py | 2 +- 5 files changed, 18 insertions(+), 15 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 5016b36e565..f911fdf77ae 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,8 +5,7 @@ #### _Black_ - `Black` now processes one-line docstrings by stripping leading and trailing spaces, - converting single quotes to triple quotes, and adding a padding space when the - docstring is empty or starts / ends with a quote. (#1740) + and adding a padding space when needed to break up """". (#1740) - `Black` now cleans up leading non-breaking spaces in comments (#2092) diff --git a/src/black/__init__.py b/src/black/__init__.py index 1b55b1d6e09..17bb036e5e6 100644 --- a/src/black/__init__.py +++ b/src/black/__init__.py @@ -2154,30 +2154,34 @@ def visit_STRING(self, leaf: Leaf) -> Iterator[Line]: # indentation of those changes the AST representation of the code. prefix = get_string_prefix(leaf.value) docstring = leaf.value[len(prefix) :] # Remove the prefix - quote_type = docstring[0] + quote_char = docstring[0] # A natural way to remove the outer quotes is to do: - # docstring = docstring.strip(quote_type) - # but that breaks on """""x""" (which is '""x') + # docstring = docstring.strip(quote_char) + # but that breaks on """""x""" (which is '""x'). # So we actually need to remove the first character and the next two # characters but only if they are the same as the first. - docstring = re.sub(r"^(.)(\1\1)?", "", docstring) - # But it is always safe to remove all of them from the right. - docstring = docstring.rstrip(quote_type) + quote_len = 1 if docstring[1] != quote_char else 3 + docstring = docstring[quote_len:-quote_len] + if is_multiline_string(leaf): indent = " " * 4 * self.current_line.depth docstring = fix_docstring(docstring, indent) else: docstring = docstring.strip() + if docstring: - # Add some padding if the docstring starts with a quote mark. - if docstring[0] == quote_type: + # Add some padding if the docstring starts / ends with a quote mark. + if docstring[0] == quote_char: docstring = " " + docstring - if docstring[-1] == quote_type: + if docstring[-1] == quote_char: docstring = docstring + " " else: # Add some padding if the docstring is empty. docstring = " " - leaf.value = prefix + quote_type * 3 + docstring + quote_type * 3 + + # We could enforce triple quotes at this point. + quote = quote_char * quote_len + leaf.value = prefix + quote + docstring + quote yield from self.visit_default(leaf) diff --git a/tests/data/docstring.py b/tests/data/docstring.py index 598ccc064ce..74532b2b91d 100644 --- a/tests/data/docstring.py +++ b/tests/data/docstring.py @@ -268,7 +268,7 @@ def oneline_empty(): def single_quotes(): - """testing""" + "testing" def believe_it_or_not_this_is_in_the_py_stdlib(): diff --git a/tests/data/function.py b/tests/data/function.py index 443e2600d12..2605c40ba24 100644 --- a/tests/data/function.py +++ b/tests/data/function.py @@ -124,7 +124,7 @@ def func_no_args(): async def coroutine(arg, exec=False): - """Single-line docstring. Multiline is harder to reformat.""" + "Single-line docstring. Multiline is harder to reformat." async with some_connection() as conn: await conn.do_what_i_mean("SELECT bobby, tables FROM xkcd", timeout=2) await asyncio.sleep(1) diff --git a/tests/data/function2.py b/tests/data/function2.py index 73d8c40b3ec..cfc259ea7bd 100644 --- a/tests/data/function2.py +++ b/tests/data/function2.py @@ -43,7 +43,7 @@ def f( def g(): - """Docstring.""" + "Docstring." def inner(): pass From bcb110f942df9c9419cb084a62ce2ac8870cd529 Mon Sep 17 00:00:00 2001 From: Mark Bell Date: Mon, 12 Apr 2021 10:02:24 +0100 Subject: [PATCH 14/14] Putting test quotes back the way they originally were. --- tests/data/function.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/data/function.py b/tests/data/function.py index 2605c40ba24..2d642c8731b 100644 --- a/tests/data/function.py +++ b/tests/data/function.py @@ -17,7 +17,7 @@ def func_no_args(): exec("new-style exec", {}, {}) return None async def coroutine(arg, exec=False): - 'Single-line docstring. Multiline is harder to reformat.' + "Single-line docstring. Multiline is harder to reformat." async with some_connection() as conn: await conn.do_what_i_mean('SELECT bobby, tables FROM xkcd', timeout=2) await asyncio.sleep(1)