Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

black 19.10b0 moves comments #1119

Closed
graingert opened this issue Oct 30, 2019 · 3 comments
Closed

black 19.10b0 moves comments #1119

graingert opened this issue Oct 30, 2019 · 3 comments
Labels
R: duplicate This issue or pull request already exists T: bug Something isn't working

Comments

@graingert
Copy link
Contributor

graingert commented Oct 30, 2019

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

--- before.py	2019-10-30 09:58:55.912054280 +0000
+++ after.py	2019-10-30 09:59:04.940064509 +0000
@@ -1,10 +1,10 @@
 def ham():
     ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff = (
-        "foo"
-    )  # tipe: str
+        "foo"  # tipe: str
+    )
 
 
 def ham():
     ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff = (
         "foo"
     )  # type: str

Expected behavior A clear and concise description of what you expected to happen.

Should behave the same regardless of "type:" or "tipe:"

Environment (please complete the following information):

N/A repros on playground

Does this bug also happen on master? To answer this, you have two options:

yes https://black.now.sh/?version=master&state=_Td6WFoAAATm1rRGAgAhARYAAAB0L-Wj4AFUAGZdAD2IimZxl1N_WlbvK5V9jFWWIeAUKtl9yAIWu0xBZRYufu53E20KvwjrvjpCNcD_sEfkfz8H1QKqCpEG4ABfAgYKTpykKZPWkBxEuvOvpIJY9YHAweNveGybKuGuXnDULzCm_9I1QQAAABnNawxy_QTjAAGCAdUCAAB71UO_scRn-wIAAAAABFla

Additional context Add any other context about the problem here.

@graingert graingert added the T: bug Something isn't working label Oct 30, 2019
@graingert
Copy link
Contributor Author

graingert commented Oct 30, 2019

this is bad because it changes the semantics of other comment annotations, eg noqa

@graingert graingert changed the title black moves comments black 19.10b0 moves comments Oct 30, 2019
@graingert
Copy link
Contributor Author

@ambv is this expected behaviour?

@ambv
Copy link
Collaborator

ambv commented Mar 4, 2020

Well. It's a known issue. In its essence it's related to #379 with the added insight that maybe it would be better to treat all comments as type comments.

@ambv ambv added the R: duplicate This issue or pull request already exists label Mar 4, 2020
@ambv ambv closed this as completed Mar 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
R: duplicate This issue or pull request already exists T: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants