[wp-trac] [WordPress Trac] #30153: Integrate PHP_CodeSniffer into build/test tools to enforce coding standards on new patches
WordPress Trac
noreply at wordpress.org
Wed Oct 29 00:01:36 UTC 2014
#30153: Integrate PHP_CodeSniffer into build/test tools to enforce coding standards
on new patches
------------------------------+-----------------------------
Reporter: westonruter | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Build/Test Tools | Version:
Severity: normal | Keywords: needs-patch
Focuses: |
------------------------------+-----------------------------
There is a community project to develop PHP_CodeSniffer standard(s) for
the WordPress Coding Standards: https://github.com/WordPress-Coding-
Standards/WordPress-Coding-Standards
Currently it only (mainly) applies to PHP files, though PHP_CodeSniffer
can also tokenize and apply sniffs to JS and CSS.
It would be helpful if PHP_CodeSniffer could automatically check new
patches being committed, to incorporate it into a pre-commit hook. A key
here is to restrict PHP_CodeSniffer to only report errors and warnings on
the lines that are part of the patch being committed. There is an initial
version of such a “phpcs-patch” script which needs to be tested and
integrated into the build/test tools:
https://github.com/xwpco/PHP_CodeSniffer/pull/1
--
Ticket URL: <https://core.trac.wordpress.org/ticket/30153>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list