Page MenuHomePhabricator

Add a linter rule for list assignments
ClosedPublic

Authored by joshuaspence on Aug 11 2015, 2:07 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 21, 1:43 PM
Unknown Object (File)
Sun, Nov 17, 3:22 AM
Unknown Object (File)
Mon, Nov 11, 5:58 AM
Unknown Object (File)
Thu, Nov 7, 3:52 AM
Unknown Object (File)
Wed, Nov 6, 6:22 PM
Unknown Object (File)
Wed, Nov 6, 6:22 PM
Unknown Object (File)
Wed, Oct 30, 7:44 AM
Unknown Object (File)
Sun, Oct 27, 2:40 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.