Page MenuHomePhabricator

Make the Arcanist comment remover less aggressive about stripping instructional comments
ClosedPublic

Authored by epriestley on Sep 5 2018, 3:54 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 20, 4:51 AM
Unknown Object (File)
Oct 14 2024, 12:14 PM
Unknown Object (File)
Oct 13 2024, 3:45 AM
Unknown Object (File)
Oct 12 2024, 3:36 PM
Unknown Object (File)
Oct 11 2024, 1:06 PM
Unknown Object (File)
Oct 11 2024, 12:59 PM
Unknown Object (File)
Oct 10 2024, 10:32 AM
Unknown Object (File)
Oct 9 2024, 10:04 AM
Subscribers

Details

Summary

Ref T13098. See PHI858. If you write this at the end of a message in arc diff:

Subscribers:
#projectname

# NEW DIFFERENTIAL REVISION
# Describe the changes in this new revision.
# ...

...we'll currently eat the #projectname as an instructional comment, even if it is followed by an empty line.

Instead, stop eating stuff once we hit the first empty line. (We escape empty lines in comments already.)

After T13098 I'll maybe adjust this to use a more explicit instruction escape, like ##, since there's no reason we're bound to #.

Test Plan

Added a unit test and made it pass.

Diff Detail

Repository
rARC Arcanist
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Sep 5 2018, 10:40 PM

https://discourse.phabricator-community.org/t/latest-arcanist-incorrecly-parses-comments/2013 reports an issue with this new behavior - probably if the Subscribers is left empty, the parser takes the first line of the comment.