Page MenuHomePhabricator

Correct some lint console renderer issues with files missing trailing newlines
ClosedPublic

Authored by epriestley on Oct 20 2017, 4:34 PM.
Tags
None
Referenced Files
F13091652: D18716.diff
Thu, Apr 25, 3:07 AM
Unknown Object (File)
Fri, Apr 19, 6:54 PM
Unknown Object (File)
Thu, Apr 11, 7:46 AM
Unknown Object (File)
Sun, Apr 7, 9:40 PM
Unknown Object (File)
Sun, Mar 31, 11:21 PM
Unknown Object (File)
Sat, Mar 30, 4:47 PM
Unknown Object (File)
Thu, Mar 28, 1:24 PM
Unknown Object (File)
Mar 24 2024, 9:36 PM
Subscribers
None

Details

Summary

See PHI162. This corrects a couple more bugs:

  • If the old file didn't end in a newline, we could end up printing two lines next to each other in the output.
  • If the patch targeted "Line 6, character 1" instead of "line 5, character 3" in a file "1\n2\n3\n4\n5\n", we would fail to figure out what that meant when computing an offset because the last line has 0 characters on it.
Test Plan

Added failing unit tests, made them pass. Also tested with some fake linters similar to the ones described in PHI162.

Diff Detail

Repository
rARC Arcanist
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

epriestley created this revision.
This revision is now accepted and ready to land.Oct 20 2017, 5:24 PM
This revision was automatically updated to reflect the committed changes.