Loading README.md +3 −0 Changes for README.md: 3 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -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 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 parsing of `__future__` imports with renames (#389) Loading black.py +3 −3 Changes for black.py: 3 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -2082,8 +2082,8 @@ def list_comments(prefix: str, *, is_endmarker: bool) -> List[ProtoComment]: def make_comment(content: str) -> str: """Return a consistently formatted comment from the given `content` string. All comments (except for "##", "#!", "#:") should have a single space between the hash sign and the content. All comments (except for "##", "#!", "#:", '#'", "#%%") should have a single space between the hash sign and the content. If `content` didn't start with a hash sign, one is provided. """ Loading @@ -2093,7 +2093,7 @@ def make_comment(content: str) -> str: if content[0] == "#": content = content[1:] if content and content[0] not in " !:#": if content and content[0] not in " !:#'%": content = " " + content return "#" + content Loading tests/data/comments.py +3 −0 Changes for tests/data/comments.py: 3 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -70,6 +70,9 @@ def __init__(self): """Docstring for instance attribute spam.""" #' <h1>This is pweave!</h1> @fast(really=True) async def wat(): async with X.open_async() as x: # Some more comments Loading tests/data/comments3.py +6 −0 Changes for tests/data/comments3.py: 6 added lines, 0 removed lines. Original line number Diff line number Diff line # The percent-percent comments are Spyder IDE cells. #%% def func(): x = """ a really long string Loading Loading @@ -39,3 +42,6 @@ def func(): # shared between sub-exceptions are not omitted _seen=set(_seen), ) #%% No newline at end of file Loading
README.md +3 −0 Changes for README.md: 3 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -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 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 parsing of `__future__` imports with renames (#389) Loading
black.py +3 −3 Changes for black.py: 3 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -2082,8 +2082,8 @@ def list_comments(prefix: str, *, is_endmarker: bool) -> List[ProtoComment]: def make_comment(content: str) -> str: """Return a consistently formatted comment from the given `content` string. All comments (except for "##", "#!", "#:") should have a single space between the hash sign and the content. All comments (except for "##", "#!", "#:", '#'", "#%%") should have a single space between the hash sign and the content. If `content` didn't start with a hash sign, one is provided. """ Loading @@ -2093,7 +2093,7 @@ def make_comment(content: str) -> str: if content[0] == "#": content = content[1:] if content and content[0] not in " !:#": if content and content[0] not in " !:#'%": content = " " + content return "#" + content Loading
tests/data/comments.py +3 −0 Changes for tests/data/comments.py: 3 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -70,6 +70,9 @@ def __init__(self): """Docstring for instance attribute spam.""" #' <h1>This is pweave!</h1> @fast(really=True) async def wat(): async with X.open_async() as x: # Some more comments Loading
tests/data/comments3.py +6 −0 Changes for tests/data/comments3.py: 6 added lines, 0 removed lines. Original line number Diff line number Diff line # The percent-percent comments are Spyder IDE cells. #%% def func(): x = """ a really long string Loading Loading @@ -39,3 +42,6 @@ def func(): # shared between sub-exceptions are not omitted _seen=set(_seen), ) #%% No newline at end of file