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
F14023603: D18716.id.diff
Thu, Nov 7, 3:04 AM
F14012458: D18716.id44936.diff
Fri, Nov 1, 1:00 PM
F14012457: D18716.id.diff
Fri, Nov 1, 1:00 PM
F14012456: D18716.id44930.diff
Fri, Nov 1, 1:00 PM
F14012447: D18716.diff
Fri, Nov 1, 12:46 PM
F14000925: D18716.id.diff
Fri, Oct 25, 2:26 AM
F13964324: D18716.id44930.diff
Oct 15 2024, 8:02 PM
Unknown Object (File)
Sep 30 2024, 12:17 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
Branch
multi1
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 18708
Build 25204: Run Core Tests
Build 25203: arc lint + arc unit

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.