Skip to content

PrettierPHPFixer - Use output of exec directly instead of writing temporary file#1483

Merged
czosel merged 1 commit intoprettier:masterfrom
grubersjoe:simplify-prettier-php-fixer
Jul 17, 2020
Merged

PrettierPHPFixer - Use output of exec directly instead of writing temporary file#1483
czosel merged 1 commit intoprettier:masterfrom
grubersjoe:simplify-prettier-php-fixer

Conversation

@grubersjoe
Copy link
Copy Markdown
Contributor

@grubersjoe grubersjoe commented Jul 13, 2020

Hey,

Instead of writing a temporary file, Prettier's output can be processed directly if the second parameter of exec is set. This simplifies the fixer and should make it a bit more efficient.

I've tested this with a Symfony codebase with around 950 files and everything seemed fine. On my machine with a SSD the change had little impact on performance, but if an HDD is used, it might.

What do you think?

@czosel
Copy link
Copy Markdown
Collaborator

czosel commented Jul 14, 2020

Looks great on a first glance 👍 I don't have experience with PHPfixer though, so i'll cc @Billz95 again 🙂

Copy link
Copy Markdown
Contributor

@Billz95 Billz95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than a nitpicking detail of using PHP_EOL the rest lgtm. 👍

Comment thread docs/recipes/php-cs-fixer/PrettierPHPFixer.php Outdated
Copy link
Copy Markdown
Contributor

@Billz95 Billz95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 seems good to me, cheers

@czosel
Copy link
Copy Markdown
Collaborator

czosel commented Jul 17, 2020

Thanks @grubersjoe & @Billz95 👍

@czosel czosel merged commit 6d4945c into prettier:master Jul 17, 2020
@grubersjoe grubersjoe deleted the simplify-prettier-php-fixer branch July 17, 2020 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants