Static analysis can help us to catch errors and (potentially) bugs before they're merged into the codebase.
Static analysis with Phan was enabled for MediaWiki extensions on our CI infrastructure as part of T153039: CI: Support running phan for extensions. We should enable/configure the tool like other extensions and reap the rewards!
We'll start by looking at a single extension/skin to get familiar with the tooling and get experience with fixing Phan bugs. Long term if we find it useful we'll apply Phan to all our codebases.
Acceptance criteria
- Make the extension-unittest-generic job run for the MinervaNeue skin.
- Copy the Phan config to the MinervaNeue skin.
- We'll start with that given it's small and not an extension (so we can see if there are any issues with skins using it).
- Review and group the errors by their difficulty to fix 'em.
- Fix the easy to fix errors (and get those merged minus the config change)
- Create tasks for errors that require further discussion (e.g. references to LqtDispatch).
Sign off steps
- Open tasks for another reading web extension e.g. MobileFrontend or Popups. Copy this line to sign off steps for the new task - we'll do one at a time until reading web projects are using phan.
Questions
- Do we need to enable any config changes e.g. check experimental?
@phuedx: Yes. Per T133664#3526092, we'll need to enable the extension-unittest-generic job for the MinervaNeue skin at least.