Making WordPress.org

Changeset 7746


Ignore:
Timestamp:
10/19/2018 11:42:29 AM (7 years ago)
Author:
iandunn
Message:

WordCamp PHPCS: Disable some undesirable rules.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/phpcs.xml.dist

    r6962 r7746  
    3232
    3333        disable WordPress.VIP.PostsPerPage.posts_per_page_posts_per_page for bin folder only
     34            should that be `WordPress.VIP.PostsPerPage.posts_per_page` ?
    3435
    3536        Look through `General` and `Squiz` sniffs for anything you might want to add.
     
    5354            anonymous functions used with add_(action|filter), and maybe other places can detect w/out false positives. don't be lazy. should only be used with cases like array_filter.
    5455            whitespace-only changes to lines that don't have logic changes, in a commit that does have logic changes. this indicates that a commit is mixing coding standards changes w/ logic changes, which adds diff noise to the logic change. they should be separate commits.
     56            unnecessary parenthesis in ternary conditions: $result = ( $condition ) ? 'foo' : 'bar'
    5557
    5658        Maybe add WordCamp\Remote_CSS\output_cached_css to customEscapingFunctions or whichever param is most appropriate
     
    144146        <exclude name="Squiz.Commenting.FileComment.SpacingAfterOpen" />
    145147
     148        <!-- There are some valid cases of this, like in identifying a closing tag from another file; e.g., in `themes/campsite-2017/footer.php`. -->
     149        <exclude name="Squiz.Commenting.InlineComment.SpacingAfter" />
     150
    146151        <!-- It's not wrong for WordPress plugin file headers. -->
    147152        <exclude name="Squiz.Commenting.FileComment.WrongStyle" />
     
    153158
    154159    <rule ref="WordPress-VIP">
    155         <exclude name="WordPress.VIP.SuperGlobalInputUsage.AccessDetected" />
    156 
    157160        <!-- We want these for the best practices, but anything specific to VIP's hosting environment is irrelevant. -->
    158161        <exclude name="WordPress.VIP.RestrictedFunctions.wp_remote_get_wp_remote_get" />
     
    162165        <exclude name="WordPress.VIP.RestrictedVariables.cache_constraints___SERVER__REMOTE_ADDR__" />
    163166        <exclude name="WordPress.VIP.DirectDatabaseQuery.NoCaching" />
     167        <exclude name="WordPress.VIP.FileSystemWritesDisallow" />
     168        <exclude name="WordPress.VIP.SuperGlobalInputUsage.AccessDetected" />
     169        <exclude name="WordPress.VIP.PostsPerPage.posts_per_page_posts_per_page" />
    164170
    165171        <!-- This is too strict. -->
     
    168174        <!-- There are some situations where this is appropriate, so leave it so the developer's discretion. -->
    169175        <exclude name="WordPress.VIP.DirectDatabaseQuery.DirectQuery" />
     176
     177        <!-- High numbers are often used as a sanity limit -->
     178        <exclude name="WordPress.VIP.PostsPerPage.posts_per_page_numberposts" />
    170179    </rule>
    171180
Note: See TracChangeset for help on using the changeset viewer.