[buddypress-trac] [BuddyPress Trac] #7228: Add PHPCS

buddypress-trac noreply at wordpress.org
Tue Aug 23 14:17:59 UTC 2016

#7228: Add PHPCS
 Reporter:  DJPaul            |      Owner:
     Type:  enhancement       |     Status:  new
 Priority:  normal            |  Milestone:  Future Release
Component:  Build/Test Tools  |    Version:
 Severity:  normal            |   Keywords:
 In order to help ensure a baseline quality of new code contributions and
 changes, I'm suggesting we think about adopting PHP Code Sniffer (PHPCS).

  PHP_CodeSniffer is a PHP script that tokenises and "sniffs" PHP... to
 detect violations of a defined coding standard. It is an essential
 development tool that ensures your code remains clean and consistent. It
 can also help prevent some common semantic errors made by developers.

 There are pretty good (though not perfect) WordPress-specific "sniffs" at

 In a perfect world, we would have these as a pre-commit hook so Committers
 don't get lazy, but initially, I assume they'd be hooked up as a Grunt
 task. I also imagine we'd run with a very minimal set of sniffs so we
 don't annoy everyone with trivial stuff until we get used to it and/or we
 all see the value.

 Probably the biggest issue is having these code sniffs only report issues
 with new/changed code, not existing code (our older code is generally not
 up to the standards of our more recent code), but there are some solutions
 for this, especially if operating on a Git checkout (see
 https://github.com/xwp/wp-dev-lib/) though there might be something we can
 do for SVN checkouts as well.

 What do people think?

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7228>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac

More information about the buddypress-trac mailing list