Page MenuHomePhabricator

Allow spaces after the `.` operator if followed by a comment.
ClosedPublic

Authored by joshuaspence on Jun 9 2014, 7:20 PM.
Tags
None
Referenced Files
F13237166: D9438.diff
Tue, May 21, 12:45 PM
F13231787: D9438.diff
Tue, May 21, 12:46 AM
F13212975: D9438.diff
Fri, May 17, 7:14 AM
Unknown Object (File)
Tue, May 7, 5:39 AM
Unknown Object (File)
Fri, May 3, 3:58 AM
Unknown Object (File)
Mon, Apr 29, 2:59 PM
Unknown Object (File)
Wed, Apr 24, 10:21 PM
Unknown Object (File)
Mar 20 2024, 6:45 PM
Subscribers

Details

Summary

Currently, 'foo'. // Some comment is not allowed by the ArcanistXHPASTLinter::LINT_BINARY_EXPRESSION_SPACING rule. I believe that in the case of a trailing comment, we should allow whitespace after the . operator.

Test Plan

Wrote and executed a unit test for this case.

Diff Detail

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

Event Timeline

joshuaspence retitled this revision from to Allow spaces after the `.` operator if followed by a comment..
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.
epriestley edited edge metadata.

Odd place to put a comment, but sure.

This revision is now accepted and ready to land.Jun 9 2014, 7:24 PM

We probably have some annotating regexps, I suppose.

epriestley updated this revision to Diff 22535.

Closed by commit rARC57f4bbae42c5 (authored by @joshuaspence, committed by @epriestley).

In D9438#9, @epriestley wrote:

We probably have some annotating regexps, I suppose.

Spot on, this is from src/markup/engine/remarkup/blockrule/PhutilRemarkupEngineRemarkupSimpleTableBlockRule.php (rPHU):

preg_match_all(
  '/\|'.
  '('.
    '(?:'.
      '(?:\\[\\[.*?\\]\\])'. // [[ ... | ... ]], a link
      '|'.
        '(?:[^|[]+)'.          // Anything but "|" or "[".
      '|'.
        '(?:\\[[^\\|[])'.      // "[" followed by anything but "[" or "|"
    ')*'.
  ')/', $line, $matches);