dadadel / pyment

Format and convert Python docstrings and generates patches
GNU General Public License v3.0
905 stars 62 forks source link

STDIN support? #53

Closed alok closed 3 years ago

alok commented 6 years ago

Just saw this, and I'd love to incorporate it into plugins like neoformat. It'd be nice if pyment could take in code via STDIN and output the newly formatted code (not a patch but just the updated code) via STDOUT. Essentially, the -w flag without actually overwriting a file.

dadadel commented 6 years ago

Hi @Alok, This is a good idea indeed. Feel free to contribute if you can, else I'll try to find some time to do so. Thanks for your issue.

bryder commented 6 years ago

I have submitted #59 to implement this.

dadadel commented 6 years ago

Thanks @alok for the suggestion and thanks @bryder for the implementation!

I close as it works well!

dadadel commented 6 years ago

As pointed out by @alok it sounds better if the default output is actually the new version of the input instead of the patch.

dadadel commented 3 years ago

I think this issue can be closed as I reopened it for a bad reason! If someone think the default behavior of Pyment should be changed so an other issue would be relevant.