accept --root, --naming-table
Summary:
## Background and rationale
At the moment we have these tools:
* hh_single_type_check -- works only on self-contained test cases; provides per-file typechecking of such files, and lots of other valuable per-file debugging/diagnostics
* hh_lite -- works on www; provides per-file typechecking of individual files
* hh_server -- works on www; provides whole-www typechecking, and also a variety of other per-file ad-hoc utilities/debugging/diagnostics
I think it is useful for hh_single_type_check to provide its existing valuable per-file debugging/diagnostics but upon files in WWW. That means we can get value out of it without first having to extract a standalone test case.
Scenario: I'm currently porting linearizations to Rust. I want to test whether my rust implementation is identical to the existing ocaml implementation. The existing ocaml implementation can be tested on a standalone test case with "hh_single_type_check --mro <file>".
But I really want to test whether my rust implementation is identical on all the cases in WWW. That's because the inheritance hierarchies in WWW are vastly more complex than anything I'll ever hope to achieve in a test case.
The best way to do this is if "hh_single_type_check --mro" could print linerizations of files within WWW, not just self-contained files.
(I actually already implemented the alternative, which is giving hh_server the debugging power to print the linearization for an arbitrary type. I wrote a diffstack for "hh_client --mro" which sends an RPC request to hh_server, and I made hh_server able to handle this. But it felt quite wrong to be adding such debugging routines into our production hh_server when they're already done perfectly well inside hh_single_type_check).
Reviewed By: Wilfred
Differential Revision:
D25891753
fbshipit-source-id:
f8945f669e36d38becb89d02769cbb1a24ac14ed