Page MenuHomePhabricator

Document sniffs that support configuration properties
Closed, ResolvedPublic

Description

Pointed out at https://gerrit.wikimedia.org/r/c/mediawiki/tools/codesniffer/+/661937/ that there isn't a place these are currently documented. There should be

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Scanning through the existing sniffs manually shows the following configuration properties:

FullQualifiedClassNameSniff: allowMainNamespace, allowInheritance, allowFunctions
ClassLevelLicenseSniff: license
PrefixedGlobalFunctionsSniff: ignoreList
ValidGlobalNameSniff: allowedPrefixes, ignoreList
ExtendClassUsageSniff: nonConfigGlobals

At least in the sniffs I wrote you will find longer pieces of documentation in comments at the top of the class as well as on these properties. I agree we should copy-paste them e.g. into the libraries README.md. That's where I would start looking for documentation.

Change 682272 had a related patch set uploaded (by Umherirrender; author: Umherirrender):

[mediawiki/tools/codesniffer@master] Add Customization section to README

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

Umherirrender triaged this task as Medium priority.

Change 682272 merged by jenkins-bot:

[mediawiki/tools/codesniffer@master] README: Add Configuration section to document adjustable sniffs

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