Page MenuHomePhabricator

Linter for EditCheck configs
Open, Needs TriagePublicFeature

Description

Feature summary (what you would like to be able to do and where):
I propose creating some kind of linter that would run on MediaWiki:Editcheck-config.json files. In, for example, TextMatch checks configurations it should validate that query is a list if "mode": "replace" is not set and it is an object if it is. It also can check if there are any deprecated parameters (like enabled, ignoreLeadSection) present.

Benefits (why should this be implemented?):
We on ruwiki ran twice into such bugs -- in first case query was an object but we forgot to add "mode": "replace", in the second case we didn't know enabled was a deprecated parameter.

Event Timeline

The linter should also check regexps for validity. Also, as an example, it should warn that usage of minimalEditcount/similar things doesn't work (if showIsSuggestion is not false) and should warn if caseSensitive/ignoreQuotedContent/etc are placed outside of config or preserveCase/isRegexp/mode/expand inside of config.