Open WybeBosch opened 3 months ago
@junstyle Is it possible that 2 days ago you released a new version that no longer supports the path filtering? Since right now its not working anymore, but if i go back a version then it works again.
Version where its having troubles loading the config 0.3.19
Version if i go back where it seems to work 0.3.18
@WybeBosch path filtering? what's your config? please paste
@junstyle My config is still the exact same as before but i was on the newer update. It was fixed in version 0.3.18, then broke again in version 0.3.19, and now its fixed again in version 0.3.20 :) So this ticket can be closed i think:)
But here is the information you asked for:
===========================================================================
This was the issue about quoting the file paths for the config / executeable Path.
The below information was when i was still on 0.3.19
Phpcsfixer vscode version: 0.3.19 Config: https://pastebin.com/aULc9CGg Using the vscode config settings
"php-cs-fixer.executablePath": "/Users/username/Local Sites/clientname/app/public/vendor/friendsofphp/php-cs-fixer/php-cs-fixer",
"php-cs-fixer.config": "/Users/username/Local Sites/clientname/app/public/.php-cs-fixer.php",
getting the same error where it doesnt like that there is a space in the root path:
runAsync: spawn "/Users/username/Local Sites/clientname/app/public/vendor/friendsofphp/php-cs-fixer/php-cs-fixer"
[
"fix",
"--using-cache=no",
"--format=json",
"--config=/Users/username/Local Sites/clientname/app/public/.php-cs-fixer.php",
"--path-mode=override",
"/var/folders/cs/_xsxqrm14d3b3_mw0svyscdh0000gn/T/pcf-tmp0.4836255640172413/poet.php"
]
{
"cwd": "/Users/username/Local Sites/clientname/app/public/web/app/themes/sage/config",
"shell": true
}
runAsync: error
{
"exitCode": 16,
"stdout": null,
"stderr": "PHP CS Fixer 3.63.1 7th Gear by Fabien Potencier, Dariusz Ruminski and contributors.\nPHP runtime: 8.1.29\n\nIn ConfigurationResolver.php line 960:\n \n The config file: \"/Users/username/Local\" does not return a \"PhpCsFixer\\ConfigIn \n terface\" instance. Got: \"integer\". \n \n\nfix [--path-mode PATH-MODE] [--allow-risky ALLOW-RISKY] [--config CONFIG] [--dry-run] [--rules RULES] [--using-cache USING-CACHE] [--cache-file CACHE-FILE] [--diff] [--format FORMAT] [--stop-on-violation] [--show-progress SHOW-PROGRESS] [--sequential] [--] [<path>...]\n\n"
}
runAsync: reject promise
PHP CS Fixer 3.63.1 7th Gear by Fabien Potencier, Dariusz Ruminski and contributors.
PHP runtime: 8.1.29
In ConfigurationResolver.php line 960:
The config file: "/Users/username/Local" does not return a "PhpCsFixer\ConfigIn
terface" instance. Got: "integer".
fix [--path-mode PATH-MODE] [--allow-risky ALLOW-RISKY] [--config CONFIG] [--dry-run] [--rules RULES] [--using-cache USING-CACHE] [--cache-file CACHE-FILE] [--diff] [--format FORMAT] [--stop-on-violation] [--show-progress SHOW-PROGRESS] [--sequential] [--] [<path>...]
Context
https://github.com/junstyle/vscode-php-cs-fixer/pull/182 I see this previous ticket resulted in making it so that ${workspaceFolder} can be used, which is great since i have about 100 sites that all have a local version of php-cs-fixer. For those in the config i use
Which equals to
The issue
However the issue is that the file path contains a space in the "Local Sites" directory, and yes its stupid that it contains a space, but its not a directory name i can change since im using "Local by Flywheel" which creates and expects the directory to be that way.
Thus resulting in this error:
As you can see it gets confused by the space in the foldername and aborts early.
Is there any way you can modify the way that executablePath is taken in? Since
I have found this other issue where someone else is having the same issue, and there they modified the internal command the extension uses i believe.
https://github.com/microsoft/vscode/issues/57148
Extra info:
macos m1
PHP 8.1.29 (cli)
Version of php-cs-fixer vscode extension 0.3.14 - 4 days ago (current)
Local version of php-cs-fixer in project "v3.61.1"
Path to local php-cs-fixer /Users/name/Local Sites/client/app/public/vendor/friendsofphp/php-cs-fixer/php-cs-fixer
Path to local php-cs-fixer config file /Users/name/Local Sites/client/app/public/.php-cs-fixer.php
config file: https://pastebin.com/9dQuesWu