-
-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Force running php-cs-fixer in sequential mode #2713
Comments
hm, we should ensure that Phpactor only runs cs fixer with a single process, but with a (new) command line flag we also need to detect the version, which isn't trivial at least. Disabling it with an env var would be safest but not sure if it's possible to disable it: |
@dantleech the code you pointed is only for default config. By default Fixer uses sequential runner, unless "future mode" is enabled or I don't know how PHPActor is configured, but instead of detecting Fixer's version I would rather require explicit config flag / env var for PHPActor integration that would enforce usage of FYI: for formatting a single file there would be 2 processes (main process + 1 worker), so not a big deal, but it's sub-optimal to spawn TCP server and additional process for that. Especially that it causes problems in this case 🙂. |
It seems like PHP-CS-Fixer/PHP-CS-Fixer#8154 can fix this, as we could fallback to sequential runner automatically if amount of files to analyse is lower or equal to chunk size. This can be considered as generic optimisation, not only for PHPActor 🙂. |
yeah, the simple option would be to allow options to be configured (as we do for phpstan and phpcs). I didn't realise sequential was the default, so that makes sense 👍 |
Hello,
PHP-CS-Fixer has recently introduced a way to run in parallel, which boost the performance drastically.
Unfortunately, when enabling this mode, its integration through phpactor crashes.
I've been advised to run php-cs-fixer using the
--sequential
option, when used through phpactor, because it only asks on a single file anyway.However I don't see any way to do that with phpactor integration (other than providing a separate config file and configure it through
language_server_php_cs_fixer.config
) which I'd see as suboptimal, as other developers of my team might not be using phpactor, thus won't need this second config file.After a quick analysis,
Phpactor\Extension\LanguageServerPhpCsFixer\LspCommand\FormatCommand
seems to be the best candidate to have this option passed to php-cs-fixer (however, I'm wondering how the version of php-cs-fixer could be detected?).I can take care of the fix, as soon as the solution feels less blury to me :)
The text was updated successfully, but these errors were encountered: