To start using PHP_CodeSniffer, enable it in repository setting. To customize standard you want to follow, add
sideci.yml in your repository and write down your desired standard in it.
linter:code_sniffer:dir: app/options:standard: CakePHP
Sider tries to detect standard and target directory for your project automatically when you specifies nothing in
sideci.yml. If it cannot find appropriate standard, it assumes PSR2 as its standard and analyzes all PHP files in your repository.
Sider tries to detect the most suitable standard and target directory for your project, based on the framework your project is using.
The following standards have been detected automatically:
The autodetection is based on file and directory structure. For the case auto detection fails, you can specify standard in
Example setting for PHP_CodeSniffer under
code_sniffer is the following:
linter:code_sniffer:dir: app/options:standard: phpcs.xmlextensions: php,inc,libencoding: utf-8ignore: app/Vendor
This option controls a major version of PHP_CodeSniffer in running. Default value is
If you wish to use PHP_CodeSniffer 2.9.x, use this option like:
This option controls directories Sider inspects. The default value is depended on frameworks PHP_CodeSniffer supports. If you use no frameworks or use any frameworks PHP_CodeSniffer does not support,
./ is adopted by default.
In case you would like to exclude specific directories, you should write it in your custom ruleset file.
This option controls command line options given to phpcs.
This option controls coding standard of your project. If you leave this value absent, Sider tries to detect standard automatically.
PSR2 is used when auto detection fails.
You available your custom ruleset to declare it in a
/path/to/MyStandard. Furthermore, you can use other standards which PHP_CodeSniffer supports below:
$ phpcs3 -iThe installed coding standards are MySource, PEAR, PSR1, PSR2, Squiz, Zend, Symfony, CakePHP, WordPress-Docs, WordPress-Core, WordPress, WordPress-Extra and WordPress-VIP
This option controls extensions of files Sider inspects. The default value is
This option controls file encoding.
A comma separated list of patterns to ignore files and directories.