]> khamidou — GitHub mirrors - arcanist.git/commit
Allow linters to share resources by shoving them on the Engine
authorepriestley <git@epriestley.com>
Mon, 12 May 2014 02:28:46 +0000 (19:28 -0700)
committerepriestley <git@epriestley.com>
Mon, 12 May 2014 02:28:46 +0000 (19:28 -0700)
commit86cbcb9f564bad6f7000e70eb57c717d127821da
treeac049a61721aea9be6f91328fdea5622560877bb
parent9bd740b1f85c6a040452c7830e967d3e5c2bc286
Allow linters to share resources by shoving them on the Engine

Summary:
Currently, the Phutil XHPAST Linter and vanilla XHPAST Linter reuse the same parse tree, but do this by having explicit knowledge of one another.

Instead, let them synchronize by writing to a glorified array of globals on the Engine. They no longer require knowledge of one another, so this can work under `.arclint`.

(This could probably be a little cleaner by putting more logic in the shared base class, but Facebook has some kind of goofy subclass of this thing and //this// patch won't disrupt it, while a cleaner one might.)

This should unblock D9057.

Test Plan: Ran unit tests and normal lint, got accurate looking results without duplicate invocations showing up in `--trace`.

Reviewers: btrahan, joshuaspence

Reviewed By: joshuaspence

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D9059
src/lint/engine/ArcanistLintEngine.php
src/lint/engine/PhutilLintEngine.php
src/lint/linter/ArcanistBaseXHPASTLinter.php
src/lint/linter/ArcanistPhutilXHPASTLinter.php
src/lint/linter/ArcanistXHPASTLinter.php
src/lint/linter/__tests__/ArcanistPhutilXHPASTLinterTestCase.php