valeryan / vscode-phpsab

Php Sniffer and Beautifier for VS Code
https://marketplace.visualstudio.com/items?itemName=ValeryanM.vscode-phpsab
MIT License
58 stars 12 forks source link

How do I convert Windows path to Linux? #105

Closed SamTyurenkov closed 10 months ago

SamTyurenkov commented 10 months ago

Hi there, I set up your extension on macOS first and it was working. Now I want to set up it on Windows and there are some paths issues:

ERROR: The file "/var/www/site/\web\app\themes\theme\functions.php" does not exist. Run "phpcs --help" for usage information SyntaxError: Unexpected token 'E', "ERROR: The"... is not valid JSON

site is a mounted volume to php-fpm-custom container at /var/www/site

My config is

    "phpsab.docker.dockerExecutablePathCS": "/var/www/site/vendor/bin/phpcs",
    "phpsab.docker.dockerExecutablePathCBF": "/var/www/site/vendor/bin/phpcbf",
    "phpsab.docker.snifferMode": "onType",
    "phpsab.docker.dockerContainer": "php-fpm-custom",
    "phpsab.docker.dockerWorkspaceRoot": "/var/www/site/",
    "phpsab.docker.dockerEnabled": true,
    "php.validate.enable": false,
    "php.validate.executablePath": "",
    "phpsab.docker.allowedAutoRulesets": [
        ".phpcs.xml",
        ".phpcs.xml.dist",
        "phpcs.xml",
        "phpcs.xml.dist",
        "phpcs.ruleset.xml",
        "ruleset.xml"
    ],
    "phpsab.docker.executablePathCS": "",
    "phpsab.docker.executablePathCBF": "",
    "phpsab.docker.snifferShowSources": true,
    "phpsab.docker.containerExec": "docker",
     "phpsab.docker.standard": ""

I use git bash as default vscode terminal

I also tried

"phpsab.docker.containerExec": "MSYS_NO_PATHCONV=1 docker"

As I need it to run docker from git bash with $(pwd) commands. But it didnt help.

SamTyurenkov commented 10 months ago

sorry, it was meant to be posted here https://github.com/mtbdata711/vscode-phpsab-docker