File tree Expand file tree Collapse file tree 3 files changed +44
-10
lines changed
Expand file tree Collapse file tree 3 files changed +44
-10
lines changed Original file line number Diff line number Diff line change 55
66from . import backend_arguments # noqa F401
77from . import check # noqa F401
8+ from . import coverage # noqa F401
89from . import incremental # noqa F401
910from . import infer # noqa F401
1011from . import initialize # noqa F401
Original file line number Diff line number Diff line change 1+ # Copyright (c) Facebook, Inc. and its affiliates.
2+ #
3+ # This source code is licensed under the MIT license found in the
4+ # LICENSE file in the root directory of this source tree.
5+
6+ import logging
7+
8+ from ... import commands , configuration as configuration_module
9+ from . import remote_logging
10+
11+ LOG : logging .Logger = logging .getLogger (__name__ )
12+
13+
14+ def run_coverage (
15+ configuration : configuration_module .Configuration , working_directory : str
16+ ) -> commands .ExitCode :
17+ LOG .warning ("Coming soon..." )
18+ return commands .ExitCode .SUCCESS
19+
20+
21+ @remote_logging .log_usage (command_name = "coverage" )
22+ def run (
23+ configuration : configuration_module .Configuration , working_directory : str
24+ ) -> commands .ExitCode :
25+ try :
26+ return run_coverage (configuration , working_directory )
27+ except Exception as error :
28+ raise commands .ClientException (
29+ f"Exception occured during pyre coverage: { error } "
30+ ) from error
Original file line number Diff line number Diff line change @@ -1439,16 +1439,19 @@ def coverage(
14391439 """
14401440 command_argument : command_arguments .CommandArguments = context .obj ["arguments" ]
14411441 configuration = _create_configuration_with_retry (command_argument , Path ("." ))
1442- return run_pyre_command (
1443- commands .Coverage (
1444- command_argument ,
1445- original_directory = os .getcwd (),
1446- configuration = configuration ,
1447- working_directory = working_directory ,
1448- ),
1449- configuration ,
1450- command_argument .noninteractive ,
1451- )
1442+ if configuration .use_command_v2 :
1443+ return v2 .coverage .run (configuration , working_directory )
1444+ else :
1445+ return run_pyre_command (
1446+ commands .Coverage (
1447+ command_argument ,
1448+ original_directory = os .getcwd (),
1449+ configuration = configuration ,
1450+ working_directory = working_directory ,
1451+ ),
1452+ configuration ,
1453+ command_argument .noninteractive ,
1454+ )
14521455
14531456
14541457@pyre .command ()
You can’t perform that action at this time.
0 commit comments