Skip to content

Commit

Permalink
Remove code block from preview test fixture
Browse files Browse the repository at this point in the history
The preview format does nothing to the code block so it was misleading
and you would think that the formatter did not format that docstring but
it actually did. Just did not format the code block.
  • Loading branch information
Glyphack authored and MichaReiser committed Feb 5, 2024
1 parent 681e893 commit f5ddfb0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 65 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
"""
Black's `Preview.module_docstring_newlines`
A code black to format
.. code-block:: python
from bokeh.events import ButtonClick
from bokeh.models import Button
button = Button()
def callback(event ):
print('Python:Click')
button.on_event(ButtonClick, callback)
"""
first_stmt_after_module_level_docstring = 1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,6 @@ input_file: crates/ruff_python_formatter/resources/test/fixtures/ruff/preview.py
```python
"""
Black's `Preview.module_docstring_newlines`
A code black to format
.. code-block:: python
from bokeh.events import ButtonClick
from bokeh.models import Button
button = Button()
def callback(event ):
print('Python:Click')
button.on_event(ButtonClick, callback)
"""
first_stmt_after_module_level_docstring = 1
Expand Down Expand Up @@ -105,20 +91,6 @@ source_type = Python
```python
"""
Black's `Preview.module_docstring_newlines`
A code black to format
.. code-block:: python
from bokeh.events import ButtonClick
from bokeh.models import Button
button = Button()
def callback(event ):
print('Python:Click')
button.on_event(ButtonClick, callback)
"""
first_stmt_after_module_level_docstring = 1
Expand Down Expand Up @@ -189,13 +161,11 @@ def f():
```diff
--- Stable
+++ Preview
@@ -13,15 +13,14 @@
def callback(event ):
print('Python:Click')
- button.on_event(ButtonClick, callback)
@@ -1,13 +1,12 @@
"""
-Black's `Preview.module_docstring_newlines`
-"""
+ button.on_event(ButtonClick, callback)"""
+Black's `Preview.module_docstring_newlines`"""
+
first_stmt_after_module_level_docstring = 1
Expand All @@ -208,7 +178,7 @@ def f():
def raw_docstring():
@@ -41,23 +40,22 @@
@@ -27,23 +26,22 @@
class RemoveNewlineBeforeClassDocstring:
Expand Down Expand Up @@ -241,7 +211,7 @@ def f():
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa[bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb] = (
cccccccc.ccccccccccccc(d).cccccccc + e
@@ -71,9 +69,9 @@
@@ -57,9 +55,9 @@
+ eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
)
Expand Down Expand Up @@ -277,21 +247,7 @@ source_type = Python

```python
"""
Black's `Preview.module_docstring_newlines`
A code black to format
.. code-block:: python
from bokeh.events import ButtonClick
from bokeh.models import Button
button = Button()
def callback(event ):
print('Python:Click')
button.on_event(ButtonClick, callback)"""
Black's `Preview.module_docstring_newlines`"""
first_stmt_after_module_level_docstring = 1
Expand Down

0 comments on commit f5ddfb0

Please sign in to comment.