Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Setting up WPCS to work in Sublime Text
Install the sublime-phpcs package, then use the "Switch coding standard" command in the Command Palette to switch between coding standards.
sublime-phpcs is insanely powerful, but if you'd prefer automatic linting, SublimeLinter-phpcs can do that.
- Install PHP Sniffer and WordPress Coding Standards per the installation instructions in the readme.
- Use Package Control to search for and install SublimeLinter then SublimeLinter-phpcs.
- From the command palette, select
Preferences: SublimeLinter Settings - Userand change
user.linters.phpcs.standardto the phpcs standard of your choice (e.g.
- If setting
standarddoesn't work, try setting
- You can also specify the standard to:
"standard": "$folder/phpcs.xml.dist". That way the linter will check the root folder of your project for a
phpcs.xml.distfile and read the location and usage of a standard from the file. This is useful if you are using custom ruleset.
- You may need to restart Sublime for these settings to take effect. Error messages appear in the bottom of the editor.