Page MenuHomePhabricator

Add a linter rule for newlines after PHP open tags
ClosedPublic

Authored by joshuaspence on Jul 2 2015, 9:43 PM.
Tags
None
Referenced Files
F18793888: D13534.diff
Thu, Oct 16, 10:24 PM
F18785468: D13534.id.diff
Tue, Oct 14, 4:14 AM
F18783270: D13534.id32714.diff
Mon, Oct 13, 5:34 AM
F18776723: D13534.id33534.diff
Fri, Oct 10, 11:08 PM
F18751814: D13534.id33881.diff
Sat, Oct 4, 12:47 PM
F18625807: D13534.diff
Sep 15 2025, 11:36 PM
F18624822: D13534.id33867.diff
Sep 15 2025, 9:07 PM
F18623854: D13534.id33881.diff
Sep 15 2025, 5:52 PM
Subscribers

Details

Summary

<?php\n\n... is much easier to read than <?php\n.... Depends on D13889 and D13890.

Test Plan

Added unit tests.

Diff Detail

Repository
rARC Arcanist
Branch
master
Lint
Lint Passed
Unit
Test Failures
Build Status
Buildable 7122
Build 7296: [Placeholder Plan] Wait for 30 Seconds
Build 7295: arc lint + arc unit

Event Timeline

joshuaspence retitled this revision from to Add a linter rule for newlines after PHP open tags.
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/ArcanistNewlineAfterOpenTagXHPASTLinterRule.php
28

I think this phrasing is maybe a little ambiguous, since it doesn't mean "a single newline character", but could be interpreted like that (i.e. "<?php\n1+1" has "a single newline character", but is not desired). Maybe "an empty line"?

This revision is now accepted and ready to land.Jul 2 2015, 9:48 PM

The fact that I needed to modify so many lint-test files was motivation for D14010.

This revision was automatically updated to reflect the committed changes.