Page MenuHomePhabricator

Switch from @codingStandardsIgnore to phpcs tags
Closed, ResolvedPublic1 Estimated Story Points

Description

The tags to exempt code from codesniffing such as @codingStandardsIgnoreLine excempt the code from all codesniffing.

Since we recently had an issue with this we're switching over to use the more modern phpcs tags which allows for a specific sniff to be exempted e.g. through phpcs:ignore Generic.Files.LineLength

More info on the new syntax is available here: https://www.axelerant.com/resources/team-blog/php_codesniffer-ignoring-standards

Event Timeline

Lokal_Profil set the point value for this task to 1.

The only reason I'm licking this one now is so that we don't forget about this solution (since the @codingStandardsIgnoreLine disspaeared from the final version of the patch where this issue was raised)

Lokal_Profil renamed this task from Switch from @codingStandards to phpcs tags to Switch from @codingStandardsIgnore to phpcs tags.Apr 2 2020, 11:04 AM

Change 585474 had a related patch set uploaded (by Lokal Profil; owner: Lokal Profil):
[mediawiki/extensions/Wikispeech@master] Switch from @codingStandardsIgnore to phpcs tags

https://gerrit.wikimedia.org/r/585474

Where did you find what rules are available?

Change 585474 merged by jenkins-bot:
[mediawiki/extensions/Wikispeech@master] Switch from @codingStandardsIgnore to phpcs tags

https://gerrit.wikimedia.org/r/585474

Where did you find what rules are available?

IIRC I dug into vendor/mediawiki/mediawiki-codesniffer/MediaWiki/Sniffs/ and grepped around a bit