Page MenuHomePhabricator

Add a linter rule for array elements
ClosedPublic

Authored by joshuaspence on Aug 10 2015, 1:38 PM.
Tags
None
Referenced Files
F19870967: D13842.diff
Sun, Mar 15, 9:08 AM
F19824437: D13842.diff
Sat, Mar 7, 11:08 PM
F19783586: D13842.id.diff
Feb 24 2026, 4:46 PM
F19775528: D13842.diff
Feb 22 2026, 1:50 AM
F19775382: D13842.diff
Feb 21 2026, 10:28 PM
F19775376: D13842.id33423.diff
Feb 21 2026, 10:27 PM
F19304012: D13842.diff
Dec 24 2025, 6:46 AM
F18818407: D13842.id33457.diff
Oct 22 2025, 12:12 AM
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.