parent
9372dc8510
commit
c6c8ef76a4
@ -953,6 +953,9 @@ More details can be found in [CONTRIBUTING](CONTRIBUTING.md).
|
|||||||
* cache is now populated when `--check` is successful for a file which speeds up
|
* cache is now populated when `--check` is successful for a file which speeds up
|
||||||
consecutive checks of properly formatted unmodified files (#448)
|
consecutive checks of properly formatted unmodified files (#448)
|
||||||
|
|
||||||
|
* fixed mangling [pweave](http://mpastell.com/pweave/) and
|
||||||
|
[Spyder IDE](https://pythonhosted.org/spyder/) special comments (#532)
|
||||||
|
|
||||||
* fixed unstable formatting when unpacking big tuples (#267)
|
* fixed unstable formatting when unpacking big tuples (#267)
|
||||||
|
|
||||||
* fixed parsing of `__future__` imports with renames (#389)
|
* fixed parsing of `__future__` imports with renames (#389)
|
||||||
|
6
black.py
6
black.py
@ -2082,8 +2082,8 @@ def list_comments(prefix: str, *, is_endmarker: bool) -> List[ProtoComment]:
|
|||||||
def make_comment(content: str) -> str:
|
def make_comment(content: str) -> str:
|
||||||
"""Return a consistently formatted comment from the given `content` string.
|
"""Return a consistently formatted comment from the given `content` string.
|
||||||
|
|
||||||
All comments (except for "##", "#!", "#:") should have a single space between
|
All comments (except for "##", "#!", "#:", '#'", "#%%") should have a single
|
||||||
the hash sign and the content.
|
space between the hash sign and the content.
|
||||||
|
|
||||||
If `content` didn't start with a hash sign, one is provided.
|
If `content` didn't start with a hash sign, one is provided.
|
||||||
"""
|
"""
|
||||||
@ -2093,7 +2093,7 @@ def make_comment(content: str) -> str:
|
|||||||
|
|
||||||
if content[0] == "#":
|
if content[0] == "#":
|
||||||
content = content[1:]
|
content = content[1:]
|
||||||
if content and content[0] not in " !:#":
|
if content and content[0] not in " !:#'%":
|
||||||
content = " " + content
|
content = " " + content
|
||||||
return "#" + content
|
return "#" + content
|
||||||
|
|
||||||
|
@ -70,6 +70,9 @@ def __init__(self):
|
|||||||
"""Docstring for instance attribute spam."""
|
"""Docstring for instance attribute spam."""
|
||||||
|
|
||||||
|
|
||||||
|
#' <h1>This is pweave!</h1>
|
||||||
|
|
||||||
|
|
||||||
@fast(really=True)
|
@fast(really=True)
|
||||||
async def wat():
|
async def wat():
|
||||||
async with X.open_async() as x: # Some more comments
|
async with X.open_async() as x: # Some more comments
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
# The percent-percent comments are Spyder IDE cells.
|
||||||
|
|
||||||
|
#%%
|
||||||
def func():
|
def func():
|
||||||
x = """
|
x = """
|
||||||
a really long string
|
a really long string
|
||||||
@ -39,3 +42,6 @@ def func():
|
|||||||
# shared between sub-exceptions are not omitted
|
# shared between sub-exceptions are not omitted
|
||||||
_seen=set(_seen),
|
_seen=set(_seen),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
#%%
|
Loading…
Reference in New Issue
Block a user