[wp-trac] [WordPress Trac] #41057: Update PHP codebase per WordPress PHP Coding Standards
WordPress Trac
noreply at wordpress.org
Fri Jun 16 19:47:23 UTC 2017
#41057: Update PHP codebase per WordPress PHP Coding Standards
----------------------------+-----------------------
Reporter: netweb | Owner: pento
Type: task (blessed) | Status: accepted
Priority: normal | Milestone: 4.9
Component: General | Version:
Severity: normal | Resolution:
Keywords: | Focuses:
----------------------------+-----------------------
Comment (by jrf):
@pento May I suggest to document the exclusions (both files as well as
rules) to make life easier for the next person ?
Also, you may want to change this part:
{{{
<rule ref="WordPress-Core" />
<rule ref="WordPress.Arrays.ArrayIndentation">
<exclude-pattern>*</exclude-pattern>
</rule>
}}}
to:
{{{
<rule ref="WordPress-Core">
<!-- Exclude one rule, but only for the fixer. -->
<!-- Bug report: https://github.com/WordPress-Coding-Standards
/WordPress-Coding-Standards/issues/968 -->
<exclude phpcbf-only="true" name="WordPress.Arrays.ArrayIndentation"
/>
</rule>
}}}
Ref: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-
ruleset.xml#selectively-applying-rules
For some more tips & tricks, you may want to leaf through this slide deck:
https://speakerdeck.com/jrf/dont-work-for-phpcs-make-phpcs-work-for-you-1
--
Ticket URL: <https://core.trac.wordpress.org/ticket/41057#comment:27>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list