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
F14494917: D9438.id22534.diff
Fri, Jan 3, 6:59 AM
Unknown Object (File)
Wed, Jan 1, 3:35 AM
Unknown Object (File)
Sun, Dec 29, 7:56 AM
Unknown Object (File)
Sun, Dec 22, 5:04 AM
Unknown Object (File)
Sun, Dec 15, 12:39 PM
Unknown Object (File)
Sat, Dec 14, 1:47 PM
Unknown Object (File)
Thu, Dec 12, 8:54 AM
Unknown Object (File)
Nov 28 2024, 8:34 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);