HomePhabricator

Allow linters to share resources by shoving them on the Engine

Authored by epriestley.

Description

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

Details

Committed
epriestleyMay 12 2014, 2:28 AM
Pushed
epriestleyMay 12 2014, 2:28 AM
Reviewer
joshuaspence
Differential Revision
D9059: Allow linters to share resources by shoving them on the Engine
Parents
rARC9bd740b1f85c: Remove severity options from some linters.
Branches
Unknown
Tags
Unknown

Event Timeline