|
1 | 1 | <?xml version="1.0"?> |
2 | 2 | <ruleset> |
3 | | - <rule ref="./vendor/wikibase/wikibase-codesniffer/Wikibase" /> |
4 | 3 |
|
5 | | - <rule ref="Generic.Files.LineLength"> |
6 | | - <properties> |
7 | | - <property name="lineLimit" value="120" /> |
8 | | - </properties> |
| 4 | + <!-- This rule set includes all rules from the MediaWiki rule set, see |
| 5 | + https://github.com/wikimedia/mediawiki-tools-codesniffer/blob/master/MediaWiki/ruleset.xml |
| 6 | + --> |
| 7 | + <rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki"> |
| 8 | + |
| 9 | + <!-- The function comment sniff is way to rigorous about way to many details that need |
| 10 | + exceptions: |
| 11 | + * It complains about missing documentation on fully self-explanatory function headers |
| 12 | + with strict type hints. |
| 13 | + * It complains about missing documentation if there is a proper @see tag. |
| 14 | + * It complains about duplicate spaces in "@param <type> $<var>", but removing these |
| 15 | + doesn't make the code easier to read. |
| 16 | + * It does not understand "@param <type> [$optional,…]. --> |
| 17 | + <exclude name="MediaWiki.Commenting.FunctionComment" /> |
| 18 | + |
| 19 | + <exclude name="MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationPrivate" /> |
| 20 | + <exclude name="MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationProtected" /> |
| 21 | + |
| 22 | + <!-- We disagree with the idea of certain characters making comments "illegal" and blocking |
| 23 | + patches from being merged. This behaves especially bad on code examples. --> |
| 24 | + <exclude name="MediaWiki.Commenting.IllegalSingleLineComment" /> |
| 25 | + |
| 26 | + <!-- Starting a function's body with an empty line can be helpful after a very large header. |
| 27 | + The code is not guaranteed to be easier to read if this is disallowed. --> |
| 28 | + <exclude name="MediaWiki.WhiteSpace.DisallowEmptyLineFunctions" /> |
| 29 | + |
| 30 | + <!-- Even if we encourage to use a space in "function ()", we don't think this sniff should |
| 31 | + block patches from being merged. --> |
| 32 | + <exclude name="MediaWiki.WhiteSpace.SpaceAfterClosure" /> |
| 33 | + |
| 34 | + <!-- Even if we encourage to use spaces in comments, we don't think this sniff should block |
| 35 | + patches from being merged. --> |
| 36 | + <exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment" /> |
9 | 37 | </rule> |
10 | 38 |
|
11 | 39 | <!-- Metrics are intentionally not part of the base Wikibase CodeSniffer rule set. --> |
|
0 commit comments