Page MenuHomePhabricator

[Wikispeech] Investigate excluded code sniffs
Closed, ResolvedPublic2 Estimated Story Points

Description

With https://gerrit.wikimedia.org/r/360291 and https://gerrit.wikimedia.org/r/362785 Wikispeech got mediawiki-codesniffer bumped fopm 0.7.2 to 0.10.0. The upgrade however required that certain sniffs were excluded/deactivated for it to pass.

Investigate what blocks the sniffs and where appropriate amend and reactivate.

		<exclude name="MediaWiki.Commenting.FunctionComment.MissingParamName" />
		<exclude name="MediaWiki.Commenting.FunctionComment.MissingParamTag" />
		<exclude name="MediaWiki.Commenting.FunctionComment.ParamNameNoMatch" />
		<exclude name="MediaWiki.Commenting.FunctionComment.SpacingAfter" />
		<exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationProtected" />
		<exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic" />

Event Timeline

Lokal_Profil set the point value for this task to 2.

All of the excluded sniffs are related to documentation/commenting so it should be doable to fix them.

Change 363292 had a related patch set uploaded (by Lokal Profil; owner: Lokal Profil):
[mediawiki/extensions/Wikispeech@master] Re-enable disabled sniffs

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

The newest patch re-activates all sniffs other than those relating to the newest rules on one class per file (with the same name).

Change 363292 merged by jenkins-bot:
[mediawiki/extensions/Wikispeech@master] Re-enable disabled sniffs

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

Mentioned in SAL (#wikimedia-cloud) [2017-09-02T12:33:18Z] <Lokal_Profil> Deploy latest from Git master: fe34de0 (T169483)

I just noticed that phpc(s|bf) runs on a lot of files (my guess is the whole vendor directory) when I run it in my Vagrant installation. There is an exclude-pattern element in .phpcs.xml, but that doesn't seem work as intended.

I just noticed that phpc(s|bf) runs on a lot of files (my guess is the whole vendor directory) when I run it in my Vagrant installation. There is an exclude-pattern element in .phpcs.xml, but that doesn't seem work as intended.

On gerrit it's only checking 14 files so that seems to be an issue in how Vagrant is running it. Checking on my Vagrant it also only sniffs 14 files.

Are you running it through composer test? If I just run php -p -s then yes it sniffs 2497 files.