Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upUse two spaces before inline comments #59
Comments
|
I'm using this bug to get familiar with the internals of prettier and this plugin. My naive approach to getting this done is by adding a new prettier printer option to specify a trailing comment prefix here. Something like This change yields the following output for $ prettier --plugin=. --parser=python tests/python_comments/comments.py
- if a: # a
+ if a: # a
# b
c
# c
d
# e
call()
# aHowever, this seems like a pretty granular configuration option to me, compared to the existing printer options. And I doubt you all want to go down the path where plugin-python is doing all the comment printer handling with the |
|
What about putting a leading |
|
@j-f1 Not sure if I'm understanding your suggestion, but here's what happens when I change plugin-python's
As you can see, it adds an extra space even to comments that aren't inline. Note: I also had to modify the final case in prettier's
|
See PEP-8: https://www.python.org/dev/peps/pep-0008/#comments