Page MenuHomePhabricator

Fix handling of empty line/column in linter tests
Needs ReviewPublic

Authored by joshuaspence on May 21 2019, 8:02 AM.

Details

Summary

Ref T6854. I tried addressing D11176#inline-49218 before landing D11176: Modify the `lint-test` file format to allow for more powerful assertions but ended up breaking linter assertions without line/column numbers (e.g. error::). This diff fixes it and also adds name to the field list.

Test Plan

Ran all linter unit tests.

Diff Detail

Repository
rARC Arcanist
Branch
lint1
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 22839
Build 31332: Run Core Tests
Build 31331: arc lint + arc unit

Event Timeline

joshuaspence created this revision.May 21 2019, 8:02 AM
joshuaspence requested review of this revision.May 21 2019, 8:02 AM

Remove description since it can span multiple lines

joshuaspence edited the summary of this revision. (Show Details)May 21 2019, 8:34 AM

Unrelated but I noticed that ArcanistBundleTestCase::testGitRepository fails locally for me when running arc unit --everything:

EXCEPTION (CommandException): Command failed with error #1!
COMMAND
git -c user.name='unit-test' -c user.email='unit-test@phabricator.com' commit -m 'Convert \n newlines to \r\n newlines.'

STDOUT
On branch master
Untracked files:
    ._image.png
    ._image_2.png
    ._image_3.png

nothing added to commit but untracked files present


STDERR
(empty)
#0 /home/josh/workspace/personal/libphutil/src/future/exec/execx.php(17): ExecFuture->resolvex()
#1 /home/josh/workspace/personal/arcanist/src/parser/__tests__/ArcanistBundleTestCase.php(179): execx('git -c user.nam...', 'unit-test', 'unit-test@phabr...', 'Convert \\n newl...')
#2 /home/josh/workspace/personal/arcanist/src/parser/__tests__/ArcanistBundleTestCase.php(85): ArcanistBundleTestCase->runGitRepositoryTests(Object(PhutilDirectoryFixture))
#3 /home/josh/workspace/personal/arcanist/src/unit/engine/phutil/PhutilTestCase.php(492): ArcanistBundleTestCase->testGitRepository()
#4 /home/josh/workspace/personal/arcanist/src/unit/engine/PhutilUnitTestEngine.php(69): PhutilTestCase->run()
#5 /home/josh/workspace/personal/arcanist/src/unit/engine/ArcanistConfigurationDrivenUnitTestEngine.php(148): PhutilUnitTestEngine->run()
#6 /home/josh/workspace/personal/arcanist/src/workflow/ArcanistUnitWorkflow.php(170): ArcanistConfigurationDrivenUnitTestEngine->run()
#7 /home/josh/workspace/personal/arcanist/scripts/arcanist.php(394): ArcanistUnitWorkflow->run()
#8 {main}