Changeset 6733
- Timestamp:
- 02/24/2018 10:33:18 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/phpcs.xml.dist
r6711 r6733 23 23 See these links for useful information: 24 24 - https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml 25 - https://github.com/squizlabs/PHP_CodeSniffer/wiki/Customisable-Sniff-Properties 25 26 - https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties 26 27 --> … … 30 31 <exclude-pattern>/build/*</exclude-pattern> 31 32 33 disable WordPress.VIP.PostsPerPage.posts_per_page_posts_per_page for bin folder only 34 32 35 Look through `General` and `Squiz` sniffs for anything you might want to add. 33 36 Is there one that detects `\Foo` instead of `use Foo`? 34 37 maximum nesting level? 35 38 function length? 39 unnecessary order-of-operations params, e.g., $foo = ( $bar || $qax ) ? 'bax' : 'quix'; 40 echoing html instead of breaking php or using an external view. e.g., echo '<div>foo</div>'; should be `?> <div>foo</div> <?php` (but on multiple lines of course) 41 var assignment immediately followed by if/while/for statement, without a blank space inbetween. maybe not in all cases, though? 42 closing divs with a comment after them. it adds clutter. when viewing source, this is an artifact from the days before browser dev tools. view in IDEs, this isn't necessary if the code is properly formatted. 43 return statement at end of function w/out blank line above it 44 no space between last @param and the @return in docblock. i know diff than core, but whitespace makes it easier to scan/read. should also have space above first @param. sometimes want no space between different types of tags, though. 45 opening/closing <?php ?> tags without a blank line after/before them, except when doing single-line like <?php foo(); ?> 46 align ? and : in multiple ternary operator statements 47 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. 36 48 37 49 Maybe add WordCamp\Remote_CSS\output_cached_css to customEscapingFunctions or whichever param is most appropriate … … 41 53 --> 42 54 55 43 56 <arg name="extensions" value="php" /> 44 57 45 58 <!-- Show sniff codes in all reports --> 46 <arg value="ps" />59 <arg value="ps" /> 47 60 <arg name="colors" /> 48 61 … … 73 86 <exclude name="Generic.Functions.FunctionCallArgumentSpacing.TooMuchSpaceAfterComma" /> 74 87 <exclude name="WordPress.WhiteSpace.OperatorSpacing.SpacingBefore" /> 88 <exclude name="WordPress.Arrays.ArrayDeclarationSpacing.SpaceBeforeArrayCloser" /> 75 89 <exclude name="PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket" /> 76 90 <exclude name="Squiz.Strings.ConcatenationSpacing.PaddingFound" /> 91 92 <!-- Warn about mis-aligned array items, but don't automatically "fix" them, because arrays in function calls get extra lines added. 93 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" /> 77 97 </rule> 78 98 … … 82 102 <exclude name="Squiz.Commenting.FileComment.Missing" /> 83 103 <exclude name="Squiz.Commenting.ClassComment.Missing" /> 104 <exclude name="Squiz.Commenting.FunctionComment.MissingParamTag" /> 84 105 <exclude name="Generic.Commenting.DocComment.MissingShort" /> 106 107 <!-- I don't see how these are useful. --> 108 <exclude name="Squiz.Commenting.FileComment.MissingPackageTag" /> 85 109 86 110 <!-- We really only use basic exceptions, so this is kind of overkill and tedious. --> 87 111 <exclude name="Squiz.Commenting.FunctionComment.EmptyThrows" /> 112 113 <!-- Whitespace makes things more readable. --> 114 <exclude name="Squiz.Commenting.FileComment.SpacingAfterOpen" /> 115 116 <!-- It's not wrong for WordPress plugin file headers. --> 117 <exclude name="Squiz.Commenting.FileComment.WrongStyle" /> 88 118 </rule> 89 119 … … 95 125 <exclude name="WordPress.VIP.RestrictedFunctions.file_get_contents_file_get_contents" /> 96 126 <exclude name="WordPress.VIP.RestrictedFunctions.get_posts_get_posts" /> 127 128 <!-- This is too strict. --> 129 <exclude name="WordPress.VIP.SlowDBQuery.slow_db_query_meta_query" /> 97 130 </rule> 98 131
Note: See TracChangeset
for help on using the changeset viewer.