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
F13130956: D18509.diff
Wed, May 1, 1:11 PM
F13128479: D18509.diff
Wed, May 1, 12:04 AM
Unknown Object (File)
Mon, Apr 8, 9:01 PM
Unknown Object (File)
Mar 4 2024, 7:05 AM
Unknown Object (File)
Feb 24 2024, 4:41 PM
Unknown Object (File)
Feb 24 2024, 4:06 PM
Unknown Object (File)
Feb 24 2024, 3:02 PM
Unknown Object (File)
Feb 3 2024, 8:49 AM
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.