Page MenuHomePhabricator

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

Authored by joshuaspence on May 21 2019, 8:02 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Mar 16, 11:12 AM
Unknown Object (File)
Thu, Mar 7, 10:14 AM
Unknown Object (File)
Fri, Mar 1, 5:25 AM
Unknown Object (File)
Feb 21 2024, 1:45 PM
Unknown Object (File)
Feb 3 2024, 10:32 PM
Unknown Object (File)
Feb 3 2024, 10:32 PM
Unknown Object (File)
Feb 3 2024, 10:32 PM
Unknown Object (File)
Jan 22 2024, 9:34 AM
Subscribers

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 Passed
Unit
No Test Coverage
Build Status
Buildable 22839
Build 31332: Run Core Tests
Build 31331: arc lint + arc unit

Event Timeline

Remove description since it can span multiple lines

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}