Page MenuHomePhabricator

Add a linter rule for list assignments
ClosedPublic

Authored by joshuaspence on Aug 11 2015, 2:07 PM.
Tags
None
Referenced Files
F18114791: D13870.id33497.diff
Wed, Aug 13, 5:38 AM
F18096968: D13870.id33514.diff
Fri, Aug 8, 10:32 AM
F18096850: D13870.diff
Fri, Aug 8, 9:29 AM
F18085060: D13870.diff
Tue, Aug 5, 6:58 PM
Unknown Object (File)
May 2 2025, 11:45 PM
Unknown Object (File)
Apr 23 2025, 12:12 PM
Unknown Object (File)
Apr 20 2025, 7:10 AM
Unknown Object (File)
Apr 16 2025, 8:16 PM
Subscribers

Details

Summary

Add a linter rule to prevent trailing commas in a list assignment. list($x, $y,) is equivalent to list($x, $y), but the latter is cleaner and should be preferred.

Test Plan

Added test cases.

Diff Detail

Repository
rARC Arcanist
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

joshuaspence retitled this revision from to Add a linter rule for list assignments.
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.
epriestley edited edge metadata.
epriestley added inline comments.
src/lint/linter/__tests__/xhpast/list-assignment.lint-test
11

(The whitespace this decides on is a little weird.)

This revision is now accepted and ready to land.Aug 11 2015, 2:07 PM
This revision was automatically updated to reflect the committed changes.