(
files: list[str], docstring_translate_files: list[str], sync_test_files: list[str]
)
| 283 | |
| 284 | |
| 285 | def process_files( |
| 286 | files: list[str], docstring_translate_files: list[str], sync_test_files: list[str] |
| 287 | ) -> None: |
| 288 | for file in files: |
| 289 | if "__init__" not in file or "__init__" and "test" in file: |
| 290 | with open(file, "r+") as f: |
| 291 | lines = f.readlines() |
| 292 | lines = apply_is_sync(lines, file) |
| 293 | lines = translate_coroutine_types(lines) |
| 294 | lines = translate_async_sleeps(lines) |
| 295 | if file in docstring_translate_files: |
| 296 | lines = translate_docstrings(lines) |
| 297 | if file in sync_test_files: |
| 298 | lines = translate_imports(lines) |
| 299 | lines = process_ignores(lines) |
| 300 | f.seek(0) |
| 301 | f.writelines(lines) |
| 302 | f.truncate() |
| 303 | |
| 304 | |
| 305 | def apply_is_sync(lines: list[str], file: str) -> list[str]: |
no test coverage detected