Page MenuHomePhabricator

Add a linter rule for array elements
ClosedPublic

Authored by joshuaspence on Aug 10 2015, 1:38 PM.
Tags
None
Referenced Files
F15531654: D13842.id33456.diff
Wed, Apr 23, 12:11 PM
F15525116: D13842.diff
Mon, Apr 21, 12:20 PM
F15520624: D13842.id33456.diff
Sun, Apr 20, 7:09 AM
F15520623: D13842.diff
Sun, Apr 20, 7:09 AM
F15519621: D13842.id33423.diff
Sat, Apr 19, 11:39 PM
F15519620: D13842.id.diff
Sat, Apr 19, 11:39 PM
F15517840: D13842.id33456.diff
Sat, Apr 19, 8:53 AM
F15510466: D13842.id33423.diff
Wed, Apr 16, 8:14 PM
Subscribers

Details

Summary

Add a linter rule to ensure that array elements occupy a single line each.

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 array elements.
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/xhpast/rules/ArcanistArrayElementXHPASTLinterRule.php
38 ↗(On Diff #33423)

Maybe check $value->getLineNumber()? Or look at all the nonsemantic tokens? I think this raises a false positive on:

array(
  /* OPEN   */ 1,
  /* CLOSED */ 2,
);

...which is nonstandard in this codebase, but seems reasonable.

This revision is now accepted and ready to land.Aug 10 2015, 1:40 PM
This revision was automatically updated to reflect the committed changes.