(
state: State, metastore: MetadataStore, options: Options, type_map: dict[Expression, Type]
)
| 5137 | |
| 5138 | |
| 5139 | def write_undocumented_ref_info( |
| 5140 | state: State, metastore: MetadataStore, options: Options, type_map: dict[Expression, Type] |
| 5141 | ) -> None: |
| 5142 | # This exports some dependency information in a rather ad-hoc fashion, which |
| 5143 | # can be helpful for some tools. This is all highly experimental and could be |
| 5144 | # removed at any time. |
| 5145 | |
| 5146 | from mypy.refinfo import get_undocumented_ref_info_json |
| 5147 | |
| 5148 | if not state.tree: |
| 5149 | # We need a full AST for this. |
| 5150 | return |
| 5151 | |
| 5152 | _, data_file, _ = get_cache_names(state.id, state.xpath, options) |
| 5153 | ref_info_file = ".".join(data_file.split(".")[:-2]) + ".refs.json" |
| 5154 | assert not ref_info_file.startswith(".") |
| 5155 | |
| 5156 | deps_json = get_undocumented_ref_info_json(state.tree, type_map) |
| 5157 | metastore.write(ref_info_file, json_dumps(deps_json)) |
| 5158 | |
| 5159 | |
| 5160 | # The IPC message classes and tags for communication with build workers are |
no test coverage detected
searching dependent graphs…