Wikimedia

Re-enable codesniffer sniffs disabled in MediaWiki's PageImages extension

PHPCodeSniffer helps us stick to same coding standards across MediaWiki and it's extensions. Currently phpcs config in MediaWiki's PageImages 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 47 errors and 3 warnings in 8 files.

Work on re-enabling one sniff at a time: 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.

If this takes you longer than 3 hours, please stop and push what you managed - every little bit helps to improve the quality of our code!

Use https://phabricator.wikimedia.org/T170583 for more information and for any questions.

Task tags

  • code quality
  • php

Students who completed this task

pppery

Task type

  • code Code
  • done_all Quality Assurance
close

2017