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)
Wed, Oct 2, 9:09 PM
Unknown Object (File)
Sat, Sep 14, 2:38 PM
Unknown Object (File)
Sep 1 2024, 2:22 PM
Unknown Object (File)
Aug 19 2024, 12:49 AM
Unknown Object (File)
Aug 19 2024, 12:49 AM
Unknown Object (File)
Aug 18 2024, 3:19 PM
Unknown Object (File)
Aug 18 2024, 3:19 PM
Unknown Object (File)
Aug 17 2024, 5:27 AM
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.