Page MenuHomePhabricator

Add a linter rule for array separators
ClosedPublic

Authored by joshuaspence on Sep 22 2014, 8:41 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 27, 4:45 AM
Unknown Object (File)
Sat, Nov 23, 7:14 AM
Unknown Object (File)
Tue, Nov 19, 5:36 AM
Unknown Object (File)
Thu, Nov 14, 5:44 PM
Unknown Object (File)
Mon, Nov 11, 10:25 AM
Unknown Object (File)
Thu, Nov 7, 4:41 AM
Unknown Object (File)
Oct 18 2024, 2:34 PM
Unknown Object (File)
Oct 17 2024, 3:39 AM
Subscribers

Details

Summary

Adds a rule to ArcanistXHPASTLinter which ensures that:

  1. Single-lined arrays do not contain an unnecessary trailing comma separator after the final array value.
  2. Multi-lined arrays do contain a trailing comma seperator after the final value value.

Depends on D10534.

Test Plan

Wrote and executed unit tests.

Diff Detail

Repository
rARC Arcanist
Branch
arraycomma
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 2602
Build 2606: [Placeholder Plan] Wait for 30 Seconds

Event Timeline

joshuaspence retitled this revision from to Add a linter rule for array separators.
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.

Also, I'm not sure whether "separator" is the correct terminology here...

epriestley edited edge metadata.

I think this is reasonable. I can't immediately come up with a more useful term to describe the comma than "array separator".

src/lint/linter/ArcanistXHPASTLinter.php
199

(Minor, but same version bump as D10538.)

This revision is now accepted and ready to land.Sep 24 2014, 9:05 PM
This revision was automatically updated to reflect the committed changes.