thiemowmde added a comment.

  Related tickets:
  
  - In T243296#5820465 <https://phabricator.wikimedia.org/T243296#5820465> we 
briefly talked about the past and future of the custom Wikibase CodeSniffer 
already.
  - Via T164653 <https://phabricator.wikimedia.org/T164653> some of the 
customizations got merged into the upstream #mediawiki-codesniffer 
<https://phabricator.wikimedia.org/tag/mediawiki-codesniffer/> already.
  
  Back in 2017 I had multiple reasons to push for a custom rule set. Many of 
them are not valid any more:
  
  - Back then none of the Wikibase codebases on GitHub 
<https://github.com/wmde?q=wikibase> used the upstream MediaWiki rule set, but 
custom `phpcs.xml`, each heavily different (example 
<https://github.com/wmde/WikibaseDataModel/blob/e55e9a1a8800981fa19312f787bd34d2765d5246/phpcs.xml>).
 This was partly because one of the original developers disagreed with parts of 
the MediaWiki style guide. Introducing the Wikibase rule set was a way to first 
replace these different `phpcs.xml` with an accepted standard, and then slowly 
migrate towards the upstream standard.
  - It was a place where I was free to play around with custom rules, without 
having to convince people outside of the Wikidata team.
  - It allowed to introduce much stricter rules that won't be accepted upstream.
  - I realized that all Wikibase codebases excluded the same upstream sniffs 
that conflicted with the code style the Wikidata team agreed on. These 
exclusions are all documented and reasoned here: 
https://github.com/wmde/WikibaseCodeSniffer/blob/master/Wikibase/ruleset.xml
  - I wanted to have a single place that allows to update all codebases at 
once. This didn't worked out great. This is mostly because the MediaWiki 
CodeSniffer project got much, much more active and pushed out releases much 
faster. Keeping up with this is expensive, and might not be worth it at all. 
Because of this I removed the Wiklibase CodeSniffer from many codebases already 
<https://gerrit.wikimedia.org/r/#/q/author:thiemo+is:merged+%22mediawiki+codesniffer%22>.
  
  Reviewing some individual customizations:
  
  - I believe Wikibase.Commenting.DisallowedDocTags 
<https://github.com/wmde/WikibaseCodeSniffer/blob/master/Wikibase/Sniffs/Commenting/DisallowedDocTagsSniff.php>
 might be mostly obsolete via MediaWiki.Commenting.FunctionAnnotations 
<https://github.com/wikimedia/mediawiki-tools-codesniffer/blob/master/MediaWiki/Sniffs/Commenting/FunctionAnnotationsSniff.php>.
 It's a very different sniff, but might cover everything that matters.
  - Wikibase.Namespaces.UnnecessaryUse 
<https://github.com/wmde/WikibaseCodeSniffer/blob/master/Wikibase/Sniffs/Namespaces/UnnecessaryUseSniff.php>
 as well as Wikibase.Namespaces.UnusedUse 
<https://github.com/wmde/WikibaseCodeSniffer/blob/master/Wikibase/Sniffs/Namespaces/UnusedUseSniff.php>
 should be obsolete via MediaWiki.Classes.UnusedUseStatement 
<https://github.com/wikimedia/mediawiki-tools-codesniffer/blob/master/MediaWiki/Sniffs/Classes/UnusedUseStatementSniff.php>.
  - Wikibase.Usage.InArrayUsage 
<https://github.com/wmde/WikibaseCodeSniffer/blob/master/Wikibase/Sniffs/Usage/InArrayUsageSniff.php>
 is obsolete via MediaWiki.Usage.InArrayUsage 
<https://github.com/wikimedia/mediawiki-tools-codesniffer/blob/master/MediaWiki/Sniffs/Usage/InArrayUsageSniff.php>.
  
  This leaves only a few things:
  
  - Wikibase.Commenting.ClassLevelDocumentation 
<https://github.com/wmde/WikibaseCodeSniffer/blob/master/Wikibase/Sniffs/Commenting/ClassLevelDocumentationSniff.php>
 might be acceptable upstream when it's disabled by default. I will try to do 
this <https://gerrit.wikimedia.org/r/603495>. Until then, the Wikidata team 
might be fine with temporarily loosing this sniff.
  - Wikibase.Commenting.RedundantVarName 
<https://github.com/wmde/WikibaseCodeSniffer/blob/master/Wikibase/Sniffs/Commenting/RedundantVarNameSniff.php>
 is already upstream <https://gerrit.wikimedia.org/r/603493>.
  - Wikibase.Namespaces.FullQualifiedClassName 
<https://github.com/wmde/WikibaseCodeSniffer/blob/master/Wikibase/Sniffs/Namespaces/FullQualifiedClassNameSniff.php>
 might as well be acceptable upstream if the sniff doesn't do anything by 
default. I will try to do this as well <https://gerrit.wikimedia.org/r/603496>. 
The Wikidata team might be fine with temporarily loosing this sniff. It's still 
possible to look for this in code reviews. Or just be fine with full qualified 
class names being used without a `use`.
  - The exclusions and additions 
<https://github.com/wmde/WikibaseCodeSniffer/blob/master/Wikibase/ruleset.xml> 
are not lost. The Wikidata team just needs to repeat them in every codebase. 
That should be fine, I believe. It might even be reasonable to stop excluding 
some of these, which is something the team can then decide per codebase.
  
  **TL;DR:** I suggest to archive the WikibaseCodeSniffer.

TASK DETAIL
  https://phabricator.wikimedia.org/T253624

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: thiemowmde
Cc: Legoktm, thiemowmde, Krinkle, Ladsgroup, Addshore, Aklapper, darthmon_wmde, 
DannyS712, Nandana, Lahi, Gq86, GoranSMilovanovic, QZanden, LawExplorer, 
Lethexie, _jensen, rosalieper, Scott_WUaS, Wikidata-bugs, aude, Mbch331, Jay8g
_______________________________________________
Wikidata-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to