Page MenuHomePhabricator

Enforce trailing_comma_in_multiline linter rule in CheckUser
Closed, ResolvedPublic

Description

In order to follow a consistent style when declaring arrays, the trailing_comma_in_multiline rule should be added to the .phpcs.xml file in CheckUser, so that it is enforced by the checks performed when submitting patches to Gerrit.

A priori, we want the rule to only apply to arrays (i.e. the default value for the PHPCS elements configuration option).

Event Timeline

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

Change #1192515 had a related patch set uploaded (by Harroyo-wmf; author: Harroyo-wmf):

[mediawiki/extensions/CheckUser@master] phpcs: Enforce trailing commas in arrays

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

Change #1192520 had a related patch set uploaded (by Harroyo-wmf; author: Harroyo-wmf):

[mediawiki/extensions/CheckUser@master] phpcs: Fix array formatting (add trailing commas)

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

hector.arroyo changed the task status from Open to In Progress.Sep 30 2025, 11:18 AM
hector.arroyo claimed this task.

CheckUser #1192520 currently shows 213 linter errors for Multi-line array without trailing comma, down from 816 shown in the parent patch CheckUser #1192515.

Change #1192520 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] phpcs: Fix array formatting (add trailing commas)

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

The patches are being merged now, therefore I'm closing the ticket since there are no functional changes to test.

Change #1192515 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] phpcs: Enforce trailing commas in arrays

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