Wikimedia
Re-enable codesniffer sniffs disabled in MediaWiki's TextExtracts extension
PHPCodeSniffer helps us stick to same coding standards across MediaWiki and its extensions. Currently the phpcs config of the MediaWiki's TextExtracts extension differs from the MediaWiki one - the following sniffs are disabled:
MediaWiki.Commenting.FunctionComment.MissingParamComment
MediaWiki.Commenting.FunctionComment.MissingParamTag
MediaWiki.Commenting.FunctionComment.MissingReturn
MediaWiki.Commenting.FunctionComment.ParamNameNoMatch
MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic
MediaWiki.NamingConventions.LowerCamelFunctionsName.FunctionName
MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment
Runing phpcs
without those sniffs gives 24 errors and 9 warnings in 4 files.
Remove a sniff from the .phpcs.xml
file, run composer phpcs
or phpcs -p -s
, get a list of violations, and provide patches in Wikimedia Gerrit to fix the violations.
If you fix all violations for one sniff, also commit the removal of the exclusion from .phpcs.xml
too. Then repeat these steps for the next sniff.
Use https://phabricator.wikimedia.org/T170580 for more information and for any questions.
Task tags
Students who completed this task
pppery