Skip to content
This repository was archived by the owner on Oct 1, 2019. It is now read-only.

Is this dead? #109

Open
iddan opened this issue Aug 1, 2018 · 9 comments
Open

Is this dead? #109

iddan opened this issue Aug 1, 2018 · 9 comments

Comments

@iddan
Copy link

iddan commented Aug 1, 2018

No description provided.

@taion
Copy link
Contributor

taion commented Aug 1, 2018

Development does seem to have slowed down a lot. black is gaining a ton of traction in the Python space these days.

@bd82
Copy link

bd82 commented Jan 14, 2019

black is gaining a ton of traction in the Python space these days.

Hello, are there scenarios where a prettier python plugin would still be relevant?
Specifically one that would be implemented in pure JavaScript, meaning that no python runtime would be needed.

  • Note that such a plugin could run inside a browser.

@patrick91
Copy link
Member

Currently prettier python relies on python so this won't really work in the browser :)

I think it might still make sense to have prettier python for two reason:

  1. monorepos, it might be easier to just use prettier for all the things
  2. customisation, we might add more options than black (like support for tabs)

Don't know what other people think :)

I personally use black, but I see myself using prettier even for python :)

@bd82
Copy link

bd82 commented Jan 15, 2019

The reason I am asking is that
I am considering creating a Python Parser at some point as an example grammar
For the Chevrotain Parsing Toolkit that I have authored.

Maybe that could be used as a basis of a simpler (no Python runtime needed) Python prettier plugin.
But with Black filling that need there does not seem to be enough community interest to finish this existing project not to mention re-writing the python prettier printer using a different data structure input...

I will try to remember to post here if/when I have a JavaScript Python parser available...

@rgbkrk
Copy link

rgbkrk commented Feb 1, 2019

I would love if black was also implemented in javascript, so I could use it to format python in jupyter notebooks. 😄

@bd82
Copy link

bd82 commented Feb 1, 2019

I would love if black was also implemented in javascript, so I could use it to format python in jupyter notebooks. 😄

Would you love it enough to implement and maintain a 1000-1500 LOC
Prettier printer?

  • (similar to this but larger...)

I could provide a high quality JavaScript Python parser, but the prettier printer would still have to be implemented and maintained...

@rgbkrk
Copy link

rgbkrk commented Feb 1, 2019

Nope, I'm past capacity on projects. 😄

@bd82
Copy link

bd82 commented Feb 1, 2019

Nope, I'm past capacity on projects. 😄

Yep me too 😢

@kachkaev
Copy link
Member

kachkaev commented Jun 28, 2019

I just saw that a link to this plugin is being removed from the website and ended up in this discussion.

Those who are interested in accessing Black via Prettier's API for coherence, you may want to try the same approach as I used in prettier-plugin-elm. The plugin can just call the binary and print the result back as a single AST node. The implementation is super minimal. The only caveat of the trick is that it does not work in browsers.

Theoretically, the new approach can be tried even in this repo following a major version bump. I'm not using python, but I see the benefits of formatting all languages via a single entry point – that feels very convinient. Not to mention formatting of code blocks in markdown, which Prettier can do too! 😉

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants