Page MenuHomePhabricator

LowerCamelFunctionsNameSniff handling of MW core hooks
Closed, DuplicatePublic

Description

MW core hooks result in some functions like onSkinTemplateNavigation__Universal.

These then cause errors in extensions, which need to be excluded.

17:11:14 FILE: /workspace/src/extensions/TimedMediaHandler/includes/Hooks.php
17:11:14 ----------------------------------------------------------------------
17:11:14 FOUND 1 ERROR AFFECTING 1 LINE
17:11:14 ----------------------------------------------------------------------
17:11:14  242 | ERROR | Function name "onSkinTemplateNavigation__Universal"
17:11:14      |       | should use lower camel case.
17:11:14      |       | (MediaWiki.NamingConventions.LowerCamelFunctionsName.FunctionName)
17:11:14 ----------------------------------------------------------------------

It would be good if we have an allow list of these inside CodeSniffer, rather than needing indvidual ignores etc