Page:
PHP Code Sniffer plugin
Pages
Add a Virtual Host
Adding PHPCI Support to Your Projects
Atoum Plugin
Autobuilding from Atlassian Stash
Autobuilding from Git by Cron
Autobuilding From Git
Autobuilding From GitHub
Autobuilding From GitLab
Autobuilding from Bitbucket
Behat plugin
Campfire plugin
Clean build plugin
Codeception plugin
Composer plugin
Configuring PHPCI
Contributing to PHPCI
Copy build plugin
Deployer
Email plugin
Env plugin
Example phpci.yml
Grunt plugin
Hipchat Notify Plugin
Home
Installing PHPCI
Interpolation
Irc plugin
Lint plugin
Logging
Maintainers
MySQL plugin
PHP Code Sniffer plugin
PHP Coding Standards Fixer plugin
PHP Docblock Checker
PHPCI Config
Package build plugin
Pdepend plugin
Phar Plugin
Phing Plugin
Php copy paste detector plugin
Php loc plugin
Php mess detector plugin
Php parallel lint plugin
Php spec plugin
PhpUnit Plugin
Postgresql plugin
Project Status Images and Page
Run Builds Using Cron
Run Builds Using a Daemon
Run Builds Using a Worker
Shell plugin
Slack Notify Plugin
Technical Debt Plugin
Updating PHPCI
Vanilla Installation on OS X 10.10 Yosemite with OS X Server 4
Vanilla Mac Mavericks Server Installation Guide
XMPP notifications plugin
custom plugins setup
6
PHP Code Sniffer plugin
Mike Bronner edited this page 2015-04-01 20:52:21 -07:00
Table of Contents
Runs PHP Code Sniffer against your build.
Configuration
Options
- allowed_warnings [int, optional] - The warning limit for a successful build.
- allowed_errors [int, optional] - The error limit for a successful build.
- suffixes [array, optional] - An array of file extensions to check.
- standard [string, optional] - The standard against which your files should be checked (defaults to PSR2.)
- tab_width [int, optional] - Your chosen tab width.
- encoding [string, optional] - The file encoding you wish to check for.
- path [string, optional] - Path in which to run PHP Code Sniffer.
- ignore [array, optional] - A list of files / paths to ignore, defaults to the build_settings ignore list.
Example
Simple example where PHPCS will run on app directory, but ignore the views folder, and use PSR-1 and PSR-2 rules for validation:
test:
php_code_sniffer:
path: "app"
ignore:
- "app/views"
standard: "PSR1,PSR2"
For use with an existing project:
test:
php_code_sniffer:
standard: "/phpcs.xml" # The leading slash is needed to trigger an external ruleset.
# Without it, PHPCI looks for a rule named "phpcs.xml"
allowed_errors: -1 # Even a single error will cause the build to fail. -1 = unlimited
allowed_warnings: -1