From 19c1343d412ced55bde7fadbf699591652e2b736 Mon Sep 17 00:00:00 2001 From: Glyphack Date: Wed, 31 Jan 2024 16:20:18 +0100 Subject: [PATCH] Update snapshots to format module docstrings --- .../fixtures/ruff/docstring_code_examples.py | 16 + .../test/fixtures/ruff/quote_style.py | 1 + .../src/statement/suite.rs | 2 +- ...lack_compatibility@cases__comments.py.snap | 324 ++++++++++++++++++ ...tibility@cases__module_docstring_2.py.snap | 21 +- .../format@docstring_code_examples.py.snap | 174 +++++++++- .../tests/snapshots/format@preview.py.snap | 15 +- .../snapshots/format@quote_style.py.snap | 21 +- .../format@stub_files__suite.pyi.snap | 7 +- 9 files changed, 538 insertions(+), 43 deletions(-) create mode 100644 crates/ruff_python_formatter/tests/snapshots/black_compatibility@cases__comments.py.snap diff --git a/crates/ruff_python_formatter/resources/test/fixtures/ruff/docstring_code_examples.py b/crates/ruff_python_formatter/resources/test/fixtures/ruff/docstring_code_examples.py index d36905757efbd2..563334919ed61e 100644 --- a/crates/ruff_python_formatter/resources/test/fixtures/ruff/docstring_code_examples.py +++ b/crates/ruff_python_formatter/resources/test/fixtures/ruff/docstring_code_examples.py @@ -7,6 +7,22 @@ # See: https://docs.python.org/3/library/doctest.html ############################################################################### +""" +This is a module docstring. with code in it. It should be formatted. +.. code-block:: python + + from bokeh.events import ButtonClick + from bokeh.models import Button, CustomJS + + button = Button( ) + + button.js_on_event(ButtonClick, CustomJS( + + + code='console.log("JS:Click")')) +""" + + # The simplest doctest to ensure basic formatting works. def doctest_simple(): """ diff --git a/crates/ruff_python_formatter/resources/test/fixtures/ruff/quote_style.py b/crates/ruff_python_formatter/resources/test/fixtures/ruff/quote_style.py index 8f0d159bebd4a5..ae901040e9a51b 100644 --- a/crates/ruff_python_formatter/resources/test/fixtures/ruff/quote_style.py +++ b/crates/ruff_python_formatter/resources/test/fixtures/ruff/quote_style.py @@ -1,3 +1,4 @@ +# The next line is the docstring so it should be double quoted 'single' "double" r'r single' diff --git a/crates/ruff_python_formatter/src/statement/suite.rs b/crates/ruff_python_formatter/src/statement/suite.rs index 42756894763434..50a1b962fc7207 100644 --- a/crates/ruff_python_formatter/src/statement/suite.rs +++ b/crates/ruff_python_formatter/src/statement/suite.rs @@ -179,7 +179,7 @@ impl FormatRule> for FormatSuite { true } else if is_module_docstring_newlines_enabled(f.context()) && self.kind == SuiteKind::TopLevel - && DocstringStmt::try_from_statement(first.statement(), self.kind).is_some() + && matches!(first, SuiteChildStatement::Docstring(_)) { // Only in preview mode, insert a newline after a module level docstring, but treat // it as a docstring otherwise. See: https://github.com/psf/black/pull/3932. diff --git a/crates/ruff_python_formatter/tests/snapshots/black_compatibility@cases__comments.py.snap b/crates/ruff_python_formatter/tests/snapshots/black_compatibility@cases__comments.py.snap new file mode 100644 index 00000000000000..e8db9b2afcf16b --- /dev/null +++ b/crates/ruff_python_formatter/tests/snapshots/black_compatibility@cases__comments.py.snap @@ -0,0 +1,324 @@ +--- +source: crates/ruff_python_formatter/tests/fixtures.rs +input_file: crates/ruff_python_formatter/resources/test/fixtures/black/cases/comments.py +--- +## Input + +```python +#!/usr/bin/env python3 +# fmt: on +# Some license here. +# +# Has many lines. Many, many lines. +# Many, many, many lines. +"""Module docstring. + +Possibly also many, many lines. +""" + +import os.path +import sys + +import a +from b.c import X # some noqa comment + +try: + import fast +except ImportError: + import slow as fast + + +# Some comment before a function. +y = 1 +( + # some strings + y # type: ignore +) + + +def function(default=None): + """Docstring comes first. + + Possibly many lines. + """ + # FIXME: Some comment about why this function is crap but still in production. + import inner_imports + + if inner_imports.are_evil(): + # Explains why we have this if. + # In great detail indeed. + x = X() + return x.method1() # type: ignore + + # This return is also commented for some reason. + return default + + +# Explains why we use global state. +GLOBAL_STATE = {"a": a(1), "b": a(2), "c": a(3)} + + +# Another comment! +# This time two lines. + + +class Foo: + """Docstring for class Foo. Example from Sphinx docs.""" + + #: Doc comment for class attribute Foo.bar. + #: It can have multiple lines. + bar = 1 + + flox = 1.5 #: Doc comment for Foo.flox. One line only. + + baz = 2 + """Docstring for class attribute Foo.baz.""" + + def __init__(self): + #: Doc comment for instance attribute qux. + self.qux = 3 + + self.spam = 4 + """Docstring for instance attribute spam.""" + + +#'

This is pweave!

+ + +@fast(really=True) +async def wat(): + # This comment, for some reason \ + # contains a trailing backslash. + async with X.open_async() as x: # Some more comments + result = await x.method1() + # Comment after ending a block. + if result: + print("A OK", file=sys.stdout) + # Comment between things. + print() + + +# Some closing comments. +# Maybe Vim or Emacs directives for formatting. +# Who knows. +``` + +## Black Differences + +```diff +--- Black ++++ Ruff +@@ -6,8 +6,7 @@ + # Many, many, many lines. + """Module docstring. + +-Possibly also many, many lines. +-""" ++Possibly also many, many lines.""" + + import os.path + import sys +``` + +## Ruff Output + +```python +#!/usr/bin/env python3 +# fmt: on +# Some license here. +# +# Has many lines. Many, many lines. +# Many, many, many lines. +"""Module docstring. + +Possibly also many, many lines.""" + +import os.path +import sys + +import a +from b.c import X # some noqa comment + +try: + import fast +except ImportError: + import slow as fast + + +# Some comment before a function. +y = 1 +( + # some strings + y # type: ignore +) + + +def function(default=None): + """Docstring comes first. + + Possibly many lines. + """ + # FIXME: Some comment about why this function is crap but still in production. + import inner_imports + + if inner_imports.are_evil(): + # Explains why we have this if. + # In great detail indeed. + x = X() + return x.method1() # type: ignore + + # This return is also commented for some reason. + return default + + +# Explains why we use global state. +GLOBAL_STATE = {"a": a(1), "b": a(2), "c": a(3)} + + +# Another comment! +# This time two lines. + + +class Foo: + """Docstring for class Foo. Example from Sphinx docs.""" + + #: Doc comment for class attribute Foo.bar. + #: It can have multiple lines. + bar = 1 + + flox = 1.5 #: Doc comment for Foo.flox. One line only. + + baz = 2 + """Docstring for class attribute Foo.baz.""" + + def __init__(self): + #: Doc comment for instance attribute qux. + self.qux = 3 + + self.spam = 4 + """Docstring for instance attribute spam.""" + + +#'

This is pweave!

+ + +@fast(really=True) +async def wat(): + # This comment, for some reason \ + # contains a trailing backslash. + async with X.open_async() as x: # Some more comments + result = await x.method1() + # Comment after ending a block. + if result: + print("A OK", file=sys.stdout) + # Comment between things. + print() + + +# Some closing comments. +# Maybe Vim or Emacs directives for formatting. +# Who knows. +``` + +## Black Output + +```python +#!/usr/bin/env python3 +# fmt: on +# Some license here. +# +# Has many lines. Many, many lines. +# Many, many, many lines. +"""Module docstring. + +Possibly also many, many lines. +""" + +import os.path +import sys + +import a +from b.c import X # some noqa comment + +try: + import fast +except ImportError: + import slow as fast + + +# Some comment before a function. +y = 1 +( + # some strings + y # type: ignore +) + + +def function(default=None): + """Docstring comes first. + + Possibly many lines. + """ + # FIXME: Some comment about why this function is crap but still in production. + import inner_imports + + if inner_imports.are_evil(): + # Explains why we have this if. + # In great detail indeed. + x = X() + return x.method1() # type: ignore + + # This return is also commented for some reason. + return default + + +# Explains why we use global state. +GLOBAL_STATE = {"a": a(1), "b": a(2), "c": a(3)} + + +# Another comment! +# This time two lines. + + +class Foo: + """Docstring for class Foo. Example from Sphinx docs.""" + + #: Doc comment for class attribute Foo.bar. + #: It can have multiple lines. + bar = 1 + + flox = 1.5 #: Doc comment for Foo.flox. One line only. + + baz = 2 + """Docstring for class attribute Foo.baz.""" + + def __init__(self): + #: Doc comment for instance attribute qux. + self.qux = 3 + + self.spam = 4 + """Docstring for instance attribute spam.""" + + +#'

This is pweave!

+ + +@fast(really=True) +async def wat(): + # This comment, for some reason \ + # contains a trailing backslash. + async with X.open_async() as x: # Some more comments + result = await x.method1() + # Comment after ending a block. + if result: + print("A OK", file=sys.stdout) + # Comment between things. + print() + + +# Some closing comments. +# Maybe Vim or Emacs directives for formatting. +# Who knows. +``` + + diff --git a/crates/ruff_python_formatter/tests/snapshots/black_compatibility@cases__module_docstring_2.py.snap b/crates/ruff_python_formatter/tests/snapshots/black_compatibility@cases__module_docstring_2.py.snap index 29415b12a7af64..db9b152a3d8c8e 100644 --- a/crates/ruff_python_formatter/tests/snapshots/black_compatibility@cases__module_docstring_2.py.snap +++ b/crates/ruff_python_formatter/tests/snapshots/black_compatibility@cases__module_docstring_2.py.snap @@ -48,14 +48,16 @@ b = 2 ```diff --- Black +++ Ruff -@@ -1,6 +1,6 @@ - """I am a very helpful module docstring. +@@ -9,8 +9,7 @@ + Duis aute irure dolor in reprehenderit in voluptate + velit esse cillum dolore eu fugiat nulla pariatur. + Excepteur sint occaecat cupidatat non proident, +-sunt in culpa qui officia deserunt mollit anim id est laborum. +-""" ++sunt in culpa qui officia deserunt mollit anim id est laborum.""" + + a = 1 --With trailing spaces: -+With trailing spaces: - Lorem ipsum dolor sit amet, consectetur adipiscing elit, - sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. - Ut enim ad minim veniam, ``` ## Ruff Output @@ -63,7 +65,7 @@ b = 2 ```python """I am a very helpful module docstring. -With trailing spaces: +With trailing spaces: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, @@ -72,8 +74,7 @@ nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, -sunt in culpa qui officia deserunt mollit anim id est laborum. -""" +sunt in culpa qui officia deserunt mollit anim id est laborum.""" a = 1 diff --git a/crates/ruff_python_formatter/tests/snapshots/format@docstring_code_examples.py.snap b/crates/ruff_python_formatter/tests/snapshots/format@docstring_code_examples.py.snap index 11d4e36d4774ea..2ffc898ef7a913 100644 --- a/crates/ruff_python_formatter/tests/snapshots/format@docstring_code_examples.py.snap +++ b/crates/ruff_python_formatter/tests/snapshots/format@docstring_code_examples.py.snap @@ -13,6 +13,22 @@ input_file: crates/ruff_python_formatter/resources/test/fixtures/ruff/docstring_ # See: https://docs.python.org/3/library/doctest.html ############################################################################### +""" +This is a module docstring. with code in it. It should be formatted. +.. code-block:: python + + from bokeh.events import ButtonClick + from bokeh.models import Button, CustomJS + + button = Button( ) + + button.js_on_event(ButtonClick, CustomJS( + + + code='console.log("JS:Click")')) +""" + + # The simplest doctest to ensure basic formatting works. def doctest_simple(): """ @@ -1382,6 +1398,21 @@ source_type = Python # See: https://docs.python.org/3/library/doctest.html ############################################################################### +""" +This is a module docstring. with code in it. It should be formatted. +.. code-block:: python + + from bokeh.events import ButtonClick + from bokeh.models import Button, CustomJS + + button = Button( ) + + button.js_on_event(ButtonClick, CustomJS( + + + code='console.log("JS:Click")'))""" + + # The simplest doctest to ensure basic formatting works. def doctest_simple(): """ @@ -2754,6 +2785,21 @@ source_type = Python # See: https://docs.python.org/3/library/doctest.html ############################################################################### +""" +This is a module docstring. with code in it. It should be formatted. +.. code-block:: python + + from bokeh.events import ButtonClick + from bokeh.models import Button, CustomJS + + button = Button( ) + + button.js_on_event(ButtonClick, CustomJS( + + + code='console.log("JS:Click")'))""" + + # The simplest doctest to ensure basic formatting works. def doctest_simple(): """ @@ -4126,6 +4172,21 @@ source_type = Python # See: https://docs.python.org/3/library/doctest.html ############################################################################### +""" +This is a module docstring. with code in it. It should be formatted. +.. code-block:: python + + from bokeh.events import ButtonClick + from bokeh.models import Button, CustomJS + + button = Button( ) + + button.js_on_event(ButtonClick, CustomJS( + + + code='console.log("JS:Click")'))""" + + # The simplest doctest to ensure basic formatting works. def doctest_simple(): """ @@ -5498,6 +5559,21 @@ source_type = Python # See: https://docs.python.org/3/library/doctest.html ############################################################################### +""" +This is a module docstring. with code in it. It should be formatted. +.. code-block:: python + + from bokeh.events import ButtonClick + from bokeh.models import Button, CustomJS + + button = Button( ) + + button.js_on_event(ButtonClick, CustomJS( + + + code='console.log("JS:Click")'))""" + + # The simplest doctest to ensure basic formatting works. def doctest_simple(): """ @@ -6870,6 +6946,18 @@ source_type = Python # See: https://docs.python.org/3/library/doctest.html ############################################################################### +""" +This is a module docstring. with code in it. It should be formatted. +.. code-block:: python + + from bokeh.events import ButtonClick + from bokeh.models import Button, CustomJS + + button = Button() + + button.js_on_event(ButtonClick, CustomJS(code='console.log("JS:Click")'))""" + + # The simplest doctest to ensure basic formatting works. def doctest_simple(): """ @@ -8218,7 +8306,7 @@ def markdown_skipped_rst_directive(): ```diff --- Stable +++ Preview -@@ -480,10 +480,8 @@ +@@ -492,10 +492,8 @@ Do cool stuff:: if True: @@ -8231,7 +8319,7 @@ def markdown_skipped_rst_directive(): Done. """ -@@ -958,13 +956,11 @@ +@@ -970,13 +968,11 @@ Do cool stuff. `````` @@ -8275,6 +8363,18 @@ source_type = Python # See: https://docs.python.org/3/library/doctest.html ############################################################################### +""" +This is a module docstring. with code in it. It should be formatted. +.. code-block:: python + + from bokeh.events import ButtonClick + from bokeh.models import Button, CustomJS + + button = Button() + + button.js_on_event(ButtonClick, CustomJS(code='console.log("JS:Click")'))""" + + # The simplest doctest to ensure basic formatting works. def doctest_simple(): """ @@ -9623,7 +9723,7 @@ def markdown_skipped_rst_directive(): ```diff --- Stable +++ Preview -@@ -480,10 +480,8 @@ +@@ -492,10 +492,8 @@ Do cool stuff:: if True: @@ -9636,7 +9736,7 @@ def markdown_skipped_rst_directive(): Done. """ -@@ -958,13 +956,11 @@ +@@ -970,13 +968,11 @@ Do cool stuff. `````` @@ -9680,6 +9780,18 @@ source_type = Python # See: https://docs.python.org/3/library/doctest.html ############################################################################### +""" +This is a module docstring. with code in it. It should be formatted. +.. code-block:: python + + from bokeh.events import ButtonClick + from bokeh.models import Button, CustomJS + + button = Button() + + button.js_on_event(ButtonClick, CustomJS(code='console.log("JS:Click")'))""" + + # The simplest doctest to ensure basic formatting works. def doctest_simple(): """ @@ -11037,7 +11149,7 @@ def markdown_skipped_rst_directive(): ```diff --- Stable +++ Preview -@@ -489,10 +489,8 @@ +@@ -501,10 +501,8 @@ Do cool stuff:: if True: @@ -11050,7 +11162,7 @@ def markdown_skipped_rst_directive(): Done. """ -@@ -967,13 +965,11 @@ +@@ -979,13 +977,11 @@ Do cool stuff. `````` @@ -11094,6 +11206,18 @@ source_type = Python # See: https://docs.python.org/3/library/doctest.html ############################################################################### +""" +This is a module docstring. with code in it. It should be formatted. +.. code-block:: python + + from bokeh.events import ButtonClick + from bokeh.models import Button, CustomJS + + button = Button() + + button.js_on_event(ButtonClick, CustomJS(code='console.log("JS:Click")'))""" + + # The simplest doctest to ensure basic formatting works. def doctest_simple(): """ @@ -12442,7 +12566,7 @@ def markdown_skipped_rst_directive(): ```diff --- Stable +++ Preview -@@ -480,10 +480,8 @@ +@@ -492,10 +492,8 @@ Do cool stuff:: if True: @@ -12455,7 +12579,7 @@ def markdown_skipped_rst_directive(): Done. """ -@@ -958,13 +956,11 @@ +@@ -970,13 +968,11 @@ Do cool stuff. `````` @@ -12499,6 +12623,20 @@ source_type = Python # See: https://docs.python.org/3/library/doctest.html ############################################################################### +""" +This is a module docstring. with code in it. It should be formatted. +.. code-block:: python + + from bokeh.events import ButtonClick + from bokeh.models import Button, CustomJS + + button = Button() + + button.js_on_event( + ButtonClick, CustomJS(code='console.log("JS:Click")') + )""" + + # The simplest doctest to ensure basic formatting works. def doctest_simple(): """ @@ -13856,7 +13994,7 @@ def markdown_skipped_rst_directive(): ```diff --- Stable +++ Preview -@@ -489,10 +489,8 @@ +@@ -503,10 +503,8 @@ Do cool stuff:: if True: @@ -13869,7 +14007,7 @@ def markdown_skipped_rst_directive(): Done. """ -@@ -967,13 +965,11 @@ +@@ -981,13 +979,11 @@ Do cool stuff. `````` @@ -13913,6 +14051,18 @@ source_type = Python # See: https://docs.python.org/3/library/doctest.html ############################################################################### +""" +This is a module docstring. with code in it. It should be formatted. +.. code-block:: python + + from bokeh.events import ButtonClick + from bokeh.models import Button, CustomJS + + button = Button() + + button.js_on_event(ButtonClick, CustomJS(code='console.log("JS:Click")'))""" + + # The simplest doctest to ensure basic formatting works. def doctest_simple(): """ @@ -15261,7 +15411,7 @@ def markdown_skipped_rst_directive(): ```diff --- Stable +++ Preview -@@ -480,10 +480,8 @@ +@@ -492,10 +492,8 @@ Do cool stuff:: if True: @@ -15274,7 +15424,7 @@ def markdown_skipped_rst_directive(): Done. """ -@@ -958,13 +956,11 @@ +@@ -970,13 +968,11 @@ Do cool stuff. `````` diff --git a/crates/ruff_python_formatter/tests/snapshots/format@preview.py.snap b/crates/ruff_python_formatter/tests/snapshots/format@preview.py.snap index 3dbe31a6aa70d0..155de4722a4a34 100644 --- a/crates/ruff_python_formatter/tests/snapshots/format@preview.py.snap +++ b/crates/ruff_python_formatter/tests/snapshots/format@preview.py.snap @@ -90,8 +90,7 @@ source_type = Python ```python """ -Black's `Preview.module_docstring_newlines` -""" +Black's `Preview.module_docstring_newlines`""" first_stmt_after_module_level_docstring = 1 @@ -161,10 +160,9 @@ def f(): ```diff --- Stable +++ Preview -@@ -1,13 +1,13 @@ - """ - Black's `Preview.module_docstring_newlines` +@@ -1,12 +1,12 @@ """ + Black's `Preview.module_docstring_newlines`""" + first_stmt_after_module_level_docstring = 1 @@ -177,7 +175,7 @@ def f(): def raw_docstring(): -@@ -27,23 +27,22 @@ +@@ -26,23 +26,22 @@ class RemoveNewlineBeforeClassDocstring: @@ -210,7 +208,7 @@ def f(): aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa[bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb] = ( cccccccc.ccccccccccccc(d).cccccccc + e -@@ -57,9 +56,9 @@ +@@ -56,9 +55,9 @@ + eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee ) @@ -246,8 +244,7 @@ source_type = Python ```python """ -Black's `Preview.module_docstring_newlines` -""" +Black's `Preview.module_docstring_newlines`""" first_stmt_after_module_level_docstring = 1 diff --git a/crates/ruff_python_formatter/tests/snapshots/format@quote_style.py.snap b/crates/ruff_python_formatter/tests/snapshots/format@quote_style.py.snap index baf143abad3a94..8c29a8aa862761 100644 --- a/crates/ruff_python_formatter/tests/snapshots/format@quote_style.py.snap +++ b/crates/ruff_python_formatter/tests/snapshots/format@quote_style.py.snap @@ -4,6 +4,7 @@ input_file: crates/ruff_python_formatter/resources/test/fixtures/ruff/quote_styl --- ## Input ```python +# The next line is the docstring so it should be double quoted 'single' "double" r'r single' @@ -73,7 +74,8 @@ source_type = Python ``` ```python -'single' +# The next line is the docstring so it should be double quoted +"single" 'double' r'r single' r'r double' @@ -134,8 +136,9 @@ def docstring_single(): ```diff --- Stable +++ Preview -@@ -1,4 +1,5 @@ - 'single' +@@ -1,5 +1,6 @@ + # The next line is the docstring so it should be double quoted + "single" + 'double' r'r single' @@ -159,6 +162,7 @@ source_type = Python ``` ```python +# The next line is the docstring so it should be double quoted "single" "double" r"r single" @@ -220,7 +224,8 @@ def docstring_single(): ```diff --- Stable +++ Preview -@@ -1,4 +1,5 @@ +@@ -1,5 +1,6 @@ + # The next line is the docstring so it should be double quoted "single" + "double" @@ -245,7 +250,8 @@ source_type = Python ``` ```python -'single' +# The next line is the docstring so it should be double quoted +"single" "double" r'r single' r"r double" @@ -306,8 +312,9 @@ def docstring_single(): ```diff --- Stable +++ Preview -@@ -1,4 +1,5 @@ - 'single' +@@ -1,5 +1,6 @@ + # The next line is the docstring so it should be double quoted + "single" + "double" r'r single' diff --git a/crates/ruff_python_formatter/tests/snapshots/format@stub_files__suite.pyi.snap b/crates/ruff_python_formatter/tests/snapshots/format@stub_files__suite.pyi.snap index cea732f045fe3c..ac53706756944e 100644 --- a/crates/ruff_python_formatter/tests/snapshots/format@stub_files__suite.pyi.snap +++ b/crates/ruff_python_formatter/tests/snapshots/format@stub_files__suite.pyi.snap @@ -159,8 +159,7 @@ class ComplexStatements: ```python """Tests for empty line rules in stub files, mostly inspired by typeshed. The rules are a list of nested exceptions. See also -https://github.com/psf/black/blob/c160e4b7ce30c661ac4f2dfa5038becf1b8c5c33/src/black/lines.py#L576-L744 -""" +https://github.com/psf/black/blob/c160e4b7ce30c661ac4f2dfa5038becf1b8c5c33/src/black/lines.py#L576-L744""" import sys from typing import Self, TypeAlias, final @@ -313,7 +312,7 @@ class ComplexStatements: ```diff --- Stable +++ Preview -@@ -110,6 +110,7 @@ +@@ -109,6 +109,7 @@ class InnerClass5: def a(self): ... @@ -321,7 +320,7 @@ class ComplexStatements: field1 = 1 class InnerClass6: -@@ -119,6 +120,7 @@ +@@ -118,6 +119,7 @@ class InnerClass7: def a(self): ...