2
votes

I've got a path problem. I am trying to setup SublimeText3 and WordPress Coding Standards. I'm working width XAMPP on a Mac.

My phpcs file is located in /Applications/XAMPP/xamppfiles/PHP_CodeSniffer/scripts/

In the SublimeLinter user settings I put the path above:

"linters": {
        "phpcs": {
            "@disable": false,
            "args": [],
            "cmd": "/Applications/XAMPP/xamppfiles/PHP_CodeSniffer/scripts/phpcs",
            "excludes": [],
            "standard": "WordPress-VIP"
        }
    }

Unfortunately the editor can't locate phpcs:

SublimeLinter: WARNING: phpcs deactivated, cannot locate 'phpcs'

Does someone know what my mistake is?

Regards!

Edit:

"paths": {
        "linux": [],
        "osx": [
            "/bin/bash"
        ],
        "windows": []
    }

Then I get this error:

SublimeLinter: user shell: /bin/bash 

SublimeLinter: computed PATH using /bin/bash:

/bin/bash

/usr/local/bin

/usr/bin

/bin

/usr/sbin

/sbin

SublimeLinter: WARNING: phpcs deactivated, cannot locate 'phpcs'
1
Please have a look at my editing - user3684098
Heeeeeelp pleaaase - user3684098

1 Answers

4
votes

Remove cmd parameter.

"linters": {
    "phpcs": {
        "@disable": false,
        "args": [],
        "excludes": [],
        "standard": "WordPress-VIP"
    }
}

Then add the path to where the script exists.

"paths": {
    "linux": [],
    "osx": [
        "/Applications/XAMPP/xamppfiles/PHP_CodeSniffer/scripts"
    ],
    "windows": []
}

You may need to restart Sublime Text.