You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've removed the phpcs_standard parameter from the PHP_CodeSniffer.sublime-settings file but it doesn't seem to be picking up my projects phpcs.xml file at all.
Is there another setting I need to change somewhere to tell this plugin to use my projects phpcs.xml file?
We have installed PHP_CodeSniffer globally via composer.
This is the current PHP_CodeSniffer.sublime-settings file:
{
// Run PHPCS when a buffer is saved.
"run_on_save": false,
// Path to PHP.
"php_path": "C:/WAMP/PHP/7.1.33/php.exe",
// Path to the PHPCS script.
"phpcs_path": "C:/Users/rob/AppData/Roaming/Composer/vendor/squizlabs/php_codesniffer/bin/phpcs",
// Path to the PHPCBF script.
"phpcbf_path": "C:/Users/rob/AppData/Roaming/Composer/vendor/squizlabs/php_codesniffer/phpcbf",
// PHPCS Standard to Use. Can be a string or a dict (folder => standard).
// "phpcs_standard": "Squiz",
// Additional arguments to pass to PHPCS/PHPCBF.
"additional_args": [],
// Gutter error icon colour.
"error_scope": "comment.block",
// Gutter warning icon colour.
"warning_scope": "function"
}
The ruleset seems to work fine in other editor plugins (i.e. linter-phpcs for Atom), so I'm fairly certain that I'm missing an important configuration setting in this plugin.
The text was updated successfully, but these errors were encountered:
This project is no longer maintained and doesn't support this feature.
As an explanation, PHPCS itself will go looking for a ruleset.xml file if asked to scan a file or directory, but this plugin sends the content as STDIN so it needs to specify a coding standard path for PHPCS to use.
There are other PHPCS plugins for Sublime that may support this feature, so it's probably worth having a look at what else is available.
Our team is currently in the process of trying to get codesniffer working in sublime.
So far we have been able to set it up and get it running as it should with the default properties.
However, due to our different codebases we ideally need to use a different ruleset per project.
Having looked at the PHP_CodeSniffer documentation it says that If you run PHP_CodeSniffer without specifying a coding standard, PHP_CodeSniffer will look in the current directory, and all parent directories, for a file called either .phpcs.xml, phpcs.xml, .phpcs.xml.dist, or phpcs.xml.dist
I've removed the
phpcs_standard
parameter from the PHP_CodeSniffer.sublime-settings file but it doesn't seem to be picking up my projectsphpcs.xml
file at all.Is there another setting I need to change somewhere to tell this plugin to use my projects
phpcs.xml
file?We have installed PHP_CodeSniffer globally via composer.
This is the current PHP_CodeSniffer.sublime-settings file:
This is what our custom ruleset looks like:
The ruleset seems to work fine in other editor plugins (i.e. linter-phpcs for Atom), so I'm fairly certain that I'm missing an important configuration setting in this plugin.
The text was updated successfully, but these errors were encountered: