feat: add support for formatting code from stdin#390
Conversation
d829949 to
36b8285
Compare
19300d7 to
e3070f6
Compare
e3070f6 to
94d74e9
Compare
94d74e9 to
9a6f156
Compare
|
Thank you sir! |
|
This PR somehow breaks the Laravel Pint as well the official Laravel VSCode extensions. For context: |
|
@saade, that means that there's input on STDIN when vscode is trying to run pint |
|
As this is currently breaking for PHPStorm and VSCode I believe we should revert it for now and work to either:
|
|
There's already a fix on the other side, the problem is that they have stdin open when it should not be |
|
@calebdw can you share the link to progress on PHPStorm and VSCode? |
This reverts commit 06dca19.
|
for PHPStorm? This is still a big issue for developers running on PHPStorm |
|
I haven't seen any mention of PHPStorm and no one I know that uses PHPStorm has said anything about pint not working |
|
See #401 |
|
Hmmm, I suppose you could add a |
|
This reverted for now, and as suggested earlier:
This gives IDE and IDE plugins developers time to support the new feature without locking everyone on an old version. |
* feat: add support for formatting code from stdin * Formatting --------- Co-authored-by: Taylor Otwell <taylor@laravel.com>
* feat: add support for formatting code from stdin (#390) * feat: add support for formatting code from stdin * Formatting --------- Co-authored-by: Taylor Otwell <taylor@laravel.com> * feat: require explicit --stdin flag for stdin input * feat: add stdin support with dash and stdin-filename option - Replace --stdin flag with Unix-standard dash (-) for stdin input - Add --stdin-filename option for editor integration and context - Support both 'pint -' and 'pint --stdin-filename' patterns - Add comprehensive tests for stdin formatting scenarios * feat(stdin): respect exclusion rules for stdin-filename option - Add ConfigurationFactory::isPathExcluded() to check file exclusion rules - Check stdin-filename against default and pint.json exclusions - Return original code unchanged when path is excluded - Add comprehensive unit and feature tests for exclusion behavior * Update DefaultCommand.php --------- Co-authored-by: Caleb White <cdwhite3@pm.me> Co-authored-by: Taylor Otwell <taylor@laravel.com>
Hello!
Resolves #262, resolves #162
There's tools and editors (e.g., zed, https://jj-vcs.github.io/jj/latest/cli-reference/#jj-fix) that can integrate with formatters if the formatter accepts input on stdin and outputs the changes on stdout. This PR adds that functionality to pint
CC: @TheBlckbird, @bilogic, @serbanrobu, @gabrielbidula
Thanks!