HomePhabricator

Correct some lint console renderer issues with files missing trailing newlines

Description

Correct some lint console renderer issues with files missing trailing newlines

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.

Reviewers: amckinley

Reviewed By: amckinley

Differential Revision: https://secure.phabricator.com/D18716

Details

Provenance
epriestleyAuthored on Oct 20 2017, 4:20 PM
epriestleyPushed on Oct 20 2017, 5:49 PM
Reviewer
amckinley
Differential Revision
D18716: Correct some lint console renderer issues with files missing trailing newlines
Parents
rARC617c2e46d6a5: Make "line" and "char" strictly optional in ArcanistLintMessage
Branches
Unknown
Tags
Unknown
Build Status
Buildable 18714
Build 25214: Run Core Tests