add docker wrapper to php-cs-fixer#2388
Conversation
|
Stuck. Help is needed :) I need to get this (example with interaction): but in phpactor I get |
|
found issue. |
ae09799 to
328e70a
Compare
|
i'm not convinced this is the right way to approach this. the "wrapper" concept applies to all linters that need to call out to docker-container. it would be better to run Phpactor in the same enviornment as the project (especially as some features such as enums are only enabled when the runtime is f.e. 8.1) additionally it is better to specify the wrapper would it be possible to install multiple versions of PHP on your o/s or distribution? e.g. I had php7.4, php8.0, php8.1 on debian, and on NixOS I can basically choose. |
|
As I said before and in the description: this covers the case when phpactor can't be used in same container. I had some thoughts about to have second container with same php version for phpactor only and include project source. |
|
although what problem is this solving? i also run many dockerised projects with various requirements, and running the tooling with my globally installed version of PHP (8.1) is fine |
|
The problem is php-cs-fixer. It can't be in different versions during checks, because then cache file will be rebuilt and this takes time (from 10 seconds to 5-6 minutes). So, the problem is not directly for phpactor but for the tools around it. I'll give a try to figure out how to use phpactor in another container and how to deal with vim/mason installation but I'm not sure how to deal per project. This patch works for me and I don't need to deal with more complexity but if it is wrong way how to solve my issue then I need to align with the main vision of phpactor |
The main idea is to add wrapper to php-cs-fixer command that it could be run from docker with same php version as project. The case why can't be used sh wrapper with phpactor in project container is that phpactor itself can't be in project.
Wrapper command should be built from:
Plan is:
"language_server_php_cs_fixer.bin": "\/var\/www\/bin\/php-cs-fixer"and"language_server_php_cs_fixer.wrapper": "\/usr\/bin\/docker exec -i -u nobody container_name \/bin\/sh -c"PhpCsFixerProcess.phpon given config convert php-cs-fixer call into sh command and run byAmp\Process