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
F13140804: D9438.diff
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
Unknown Object (File)
Feb 16 2024, 9:01 AM
Unknown Object (File)
Feb 16 2024, 6:57 AM
Unknown Object (File)
Feb 16 2024, 6:56 AM
Unknown Object (File)
Feb 16 2024, 4:18 AM
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
Lint
Lint Skipped
Unit
Tests Skipped

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);