Open marcohald opened 3 years ago
Nextcloud\CodingStandard\Config
"require-dev": {
"nextcloud/coding-standard": "^0.5.0",
"vimeo/psalm": "^4.0"
},
did you have exec composer require-dev
No I did not :( After running composer install and changig the path in .php_cs.dist to an absolute it is working. With the relative Path the error is still the same
In .php_cs.dist line 5:
require_once(./lib/composer/autoload.php): Failed to open stream: No such file or directory
require_once(./lib/composer/autoload.php)
to absolute path:
require_once(__DIR__ . '/lib/composer/autoload.php')
because php-cs-fixer execute in itself path, the relative path is to php-cs-fixer path.
This works for me too. Is it probably the better way to pass the workspace path as cwd option to the child_process.spawn ? https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options So there is no need to change it on the nextcloud project. I don't know how other Projects handle this.
i see what you want to do, you can format your code on your local pc, after format the code, restore the config file: .php_cs.dist and then pull the PR, your code can review successfully.
in this extension, cwd has passed to child_process.spawn yet.
That would work, but I think maybe other users have the same issue as me, so a code fix would be the best way.
Oh okay now i have seen the code for it.
I set the "PHP-cs-fixer: Executable Path Windows" to a batch script which basically contains this:
echo %cd%
The result was the path where the File is stored and not the workspace path.
Do you think it is a good idea to change the cwd option to the actual workspace ?
I found this https://stackoverflow.com/a/64726585 to get the path of the actual workspace.
But I'm not sure whats the best way to handle multiple workspaces.
I use this Plugin in Version v0.1.158 with the integrated php-cs-fixer.phar on Windows with this PHP version:
I'd like to Fix my code for the Repository https://github.com/nextcloud/server The error i receive is
So i think this is a issue with the working path or the When i change the Path to an absolute I get this Error: