plugin-python icon indicating copy to clipboard operation
plugin-python copied to clipboard

Is this dead?

Open iddan opened this issue 7 years ago • 9 comments

iddan avatar Aug 01 '18 10:08 iddan

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

taion avatar Aug 01 '18 12:08 taion

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.

bd82 avatar Jan 14 '19 21:01 bd82

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 :)

patrick91 avatar Jan 14 '19 23:01 patrick91

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...

bd82 avatar Jan 15 '19 08:01 bd82

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

rgbkrk avatar Feb 01 '19 02:02 rgbkrk

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...

bd82 avatar Feb 01 '19 16:02 bd82

Nope, I'm past capacity on projects. 😄

rgbkrk avatar Feb 01 '19 17:02 rgbkrk

Nope, I'm past capacity on projects. 😄

Yep me too 😢

bd82 avatar Feb 01 '19 17:02 bd82

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! 😉

kachkaev avatar Jun 28 '19 16:06 kachkaev