Making WordPress.org

Changeset 6857


Ignore:
Timestamp:
03/10/2018 10:08:31 PM (7 years ago)
Author:
iandunn
Message:

WordCamp PHPCS: Add more excludes.

File:
1 edited

Legend:

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

    r6733 r6857  
    4646            align ? and : in multiple ternary operator statements
    4747            don't un-align params in function calls - e.g., multiple add_meta_box( $a, $b, $c, $d, $e, $f, $g ) calls should have the params aligned.
     48            file missing `defined WPINC or die` at start
     49            don't add `@return void`, just leave return empty
     50            no space before ++,etc operators: e.g., `$attempt_count ++;`
     51            replace explicit references to central.wordcamp.org / ID `5` with `is_main_site()` or `get_main_site_id()`
     52            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.
    4853
    4954        Maybe add WordCamp\Remote_CSS\output_cached_css to customEscapingFunctions or whichever param is most appropriate
     
    9095        <exclude name="Squiz.Strings.ConcatenationSpacing.PaddingFound" />
    9196
     97        <!-- todo get_speaker_from_user_id() meta_query should not have to line up with post_status
     98        <rule ref="WordPress.Arrays.MultipleStatementAlignment">
     99            <properties>
     100                <property name="alignMultilineItems" value="never" />
     101            </properties>
     102        </rule>
     103        -->
     104
    92105        <!-- Warn about mis-aligned array items, but don't automatically "fix" them, because arrays in function calls get extra lines added.
    93106             See https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/1305 -->
    94         <exclude phpcbf-only="true" name="WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned" />
    95         <exclude phpcbf-only="true" name="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket" />
    96         <exclude phpcbf-only="true" name="PEAR.Functions.FunctionCallSignature.CloseBracketLine" />
     107        <exclude phpcbf-only="true" name="PEAR.Functions.FunctionCallSignature" />
     108
     109        <!-- The <?php and ?> tags can't be on a line by itself inside a <textarea>, otherwise it'll add whitespace to the content. -->
     110        <exclude name="Squiz.PHP.EmbeddedPhp.ContentBeforeOpen" />
     111        <exclude name="Squiz.PHP.EmbeddedPhp.ContentAfterEnd"   />
    97112    </rule>
    98113
     
    104119        <exclude name="Squiz.Commenting.FunctionComment.MissingParamTag" />
    105120        <exclude name="Generic.Commenting.DocComment.MissingShort" />
     121        <exclude name="Squiz.Commenting.VariableComment.Missing" />
    106122
    107123        <!-- I don't see how these are useful. -->
     
    116132        <!-- It's not wrong for WordPress plugin file headers. -->
    117133        <exclude name="Squiz.Commenting.FileComment.WrongStyle" />
     134
     135        <!-- Class comments are generally not useful, so they're left out, but then PHPCS confuses the plugin headers for a class comment -->
     136        <exclude name="Squiz.Commenting.ClassComment.WrongStyle" />
    118137    </rule>
    119138
     
    125144        <exclude name="WordPress.VIP.RestrictedFunctions.file_get_contents_file_get_contents" />
    126145        <exclude name="WordPress.VIP.RestrictedFunctions.get_posts_get_posts" />
     146        <exclude name="WordPress.VIP.RestrictedFunctions.switch_to_blog_switch_to_blog" />
     147        <exclude name="WordPress.VIP.RestrictedVariables.cache_constraints___SERVER__REMOTE_ADDR__" />
    127148
    128149        <!-- This is too strict. -->
Note: See TracChangeset for help on using the changeset viewer.