laravel / pint

Laravel Pint is an opinionated PHP code style fixer for minimalists.
https://laravel.com/docs/pint
MIT License
2.75k stars 138 forks source link

Format the files using stdio #262

Closed TheBlckbird closed 5 months ago

TheBlckbird commented 5 months ago

Problem

Editors like Zed use standard input output for formatting. This means that they write the contents of the current file to stdin and replace the file on disk with whatever is written to stdout. This means that it currently just puts the default output from pint into the file.

Possible Solution

There should be an argument to pint that enables this behavior.
Example: pint --stdio

I’m using version v1.14.0

Thank you for making and maintaining this and other projects!

nunomaduro commented 5 months ago

It seems like a feature request rather than an issue. Feel free to submit a pull request on this; we will consider it.

TheBlckbird commented 5 months ago

@nunomaduro Oh, so you’re not supposed to submit Feature Request but rather PRs directly? If so, you probably should remove the issue template "Feature Request".

image

I might look into implementing this

nunomaduro commented 5 months ago

Apologize! Be sure to first analyze if is a lot of code. I think Taylor would be willing to merge only if is a few lines of code.