Page MenuHomePhabricator

Extract and cover the logic for "trimming" a lint message
ClosedPublic

Authored by epriestley on Aug 31 2017, 4:18 PM.
Tags
None
Referenced Files
F13239083: D18509.id44463.diff
Tue, May 21, 11:57 PM
F13217782: D18509.id44457.diff
Sat, May 18, 8:00 AM
F13211541: D18509.diff
Fri, May 17, 5:52 AM
F13198498: D18509.id.diff
Mon, May 13, 7:17 AM
F13195244: D18509.diff
Sun, May 12, 10:14 PM
F13179412: D18509.diff
Wed, May 8, 9:11 PM
Unknown Object (File)
Sat, May 4, 6:44 PM
Unknown Object (File)
Wed, May 1, 1:11 PM
Subscribers
None

Details

Summary

Ref T9846. Sometimes, a lint message says to replace "the big bad wolf" with "the huge bad wolf": that is, the original and replacement text are the same at the beginning, or the end, or both.

To make this easier for humans to understand, we want to just show that "big" is being replaced with "huge", not that the entire phrase is being replaced.

This logic currently happens inline in console rendering. Pull it out and cover it so a future change can simplify console rendering.

Test Plan

Ran unit tests.

Diff Detail

Repository
rARC Arcanist
Branch
ldisplay2
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 18241
Build 24532: Run Core Tests

Unit TestsFailed

TimeTest
74 msArcanistXMLLinterTestCase::Unknown Unit Message ("")
In 'attr2.lint-test', expected lint to raise error on line 1 at char 2, but no error was raised. Actually raised: error at line 2, char 1: XML73 LibXML Error error at line 2, char 1: XML65 LibXML Error
35 msArcanistAbstractMethodBodyXHPASTLinterRuleTestCase::Unknown Unit Message ("")
7 assertions passed.
13 msArcanistAbstractPrivateMethodXHPASTLinterRuleTestCase::Unknown Unit Message ("")
3 assertions passed.
13 msArcanistAliasFunctionXHPASTLinterRuleTestCase::Unknown Unit Message ("")
4 assertions passed.
13 msArcanistArrayCombineXHPASTLinterRuleTestCase::Unknown Unit Message ("")
3 assertions passed.
View Full Test Results (1 Failed · 165 Passed · 35 Skipped)

Event Timeline

Pretty sure that test failure is a false positive since I didn't change anything and I remember that test being flaky, but I'll take a look.

  • Remove failing XML test.
  • Add coverage for patches with prefix newlines.
This revision is now accepted and ready to land.Aug 31 2017, 6:55 PM
This revision was automatically updated to reflect the committed changes.