Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace wikibase-codesniffer with mediawiki-codesniffer #259

Merged
merged 1 commit into from
Jan 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 33 additions & 5 deletions .phpcs.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,40 @@
<?xml version="1.0"?>
<ruleset>
<rule ref="./vendor/wikibase/wikibase-codesniffer/Wikibase" />
<!-- This rule set includes all rules from the MediaWiki rule set, see
https://github.com/wikimedia/mediawiki-tools-codesniffer/blob/master/MediaWiki/ruleset.xml
-->
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">

<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="107" />
</properties>
<!-- The function comment sniff is way to rigorous about way to many details that need
exceptions:
* It complains about missing documentation on fully self-explanatory function headers
with strict type hints.
* It complains about missing documentation if there is a proper @see tag.
* It complains about duplicate spaces in "@param <type> $<var>", but removing these
doesn't make the code easier to read.
* It does not understand "@param <type> [$optional,…]. -->
<exclude name="MediaWiki.Commenting.FunctionComment" />

<exclude name="MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationPrivate" />
<exclude name="MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationProtected" />

<!-- We disagree with the idea of certain characters making comments "illegal" and blocking
patches from being merged. This behaves especially bad on code examples. -->
<exclude name="MediaWiki.Commenting.IllegalSingleLineComment" />

<!-- Starting a function's body with an empty line can be helpful after a very large header.
The code is not guaranteed to be easier to read if this is disallowed. -->
<exclude name="MediaWiki.WhiteSpace.DisallowEmptyLineFunctions" />

<!-- Even if we encourage to use a space in "function ()", we don't think this sniff should
block patches from being merged. -->
<exclude name="MediaWiki.WhiteSpace.SpaceAfterClosure" />

<!-- Even if we encourage to use spaces in comments, we don't think this sniff should block
patches from being merged. -->
<exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment" />
</rule>

<rule ref="MediaWiki.Commenting.MissingCovers.MissingCovers">
<exclude name="MediaWiki.Commenting.MissingCovers.MissingCovers"/>
</rule>
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"data-values/number": ">=0.1 <0.11",
"data-values/time": "~1.0|~0.2",
"phpunit/phpunit": "~8.0",
"wikibase/wikibase-codesniffer": "~1.2.0"
"mediawiki/mediawiki-codesniffer": "33.0.0"
},
"suggest": {
"data-values/geo": "Needed for deserialization of geographical values",
Expand Down