Get the list of files that were removed from "utils/not_doctested.txt", between `base_commit` and `branching_commit`. Returns: `List[str]`: List of files that were removed from "utils/not_doctested.txt".
(repo, base_commit, branching_commit)
| 377 | |
| 378 | |
| 379 | def get_new_doctest_files(repo, base_commit, branching_commit) -> List[str]: |
| 380 | """ |
| 381 | Get the list of files that were removed from "utils/not_doctested.txt", between `base_commit` and |
| 382 | `branching_commit`. |
| 383 | |
| 384 | Returns: |
| 385 | `List[str]`: List of files that were removed from "utils/not_doctested.txt". |
| 386 | """ |
| 387 | for diff_obj in branching_commit.diff(base_commit): |
| 388 | # Ignores all but the "utils/not_doctested.txt" file. |
| 389 | if diff_obj.a_path != "utils/not_doctested.txt": |
| 390 | continue |
| 391 | # Loads the two versions |
| 392 | folder = Path(repo.working_dir) |
| 393 | with checkout_commit(repo, branching_commit): |
| 394 | with open(folder / "utils/not_doctested.txt", "r", encoding="utf-8") as f: |
| 395 | old_content = f.read() |
| 396 | with open(folder / "utils/not_doctested.txt", "r", encoding="utf-8") as f: |
| 397 | new_content = f.read() |
| 398 | # Compute the removed lines and return them |
| 399 | removed_content = {x.split(" ")[0] for x in old_content.split("\n")} - { |
| 400 | x.split(" ")[0] for x in new_content.split("\n") |
| 401 | } |
| 402 | return sorted(removed_content) |
| 403 | return [] |
| 404 | |
| 405 | |
| 406 | def get_doctest_files(diff_with_last_commit: bool = False) -> List[str]: |
no test coverage detected