()
| 71 | |
| 72 | |
| 73 | def main() -> None: |
| 74 | try: |
| 75 | against_ref = sys.argv[1] |
| 76 | except IndexError as err: |
| 77 | raise RuntimeError("You must specify a base ref to run breaking change detection against") from err |
| 78 | |
| 79 | package = griffe.load( |
| 80 | "anthropic", |
| 81 | search_paths=[Path(__file__).parent.parent.joinpath("src")], |
| 82 | ) |
| 83 | old_package = griffe.load_git( |
| 84 | "anthropic", |
| 85 | ref=against_ref, |
| 86 | search_paths=["src"], |
| 87 | ) |
| 88 | assert isinstance(package, griffe.Module) |
| 89 | assert isinstance(old_package, griffe.Module) |
| 90 | |
| 91 | output = list(find_breaking_changes(package, old_package, path=["anthropic"])) |
| 92 | if output: |
| 93 | rich.print(Text("Breaking changes detected!", style=Style(color="rgb(165, 79, 87)"))) |
| 94 | rich.print() |
| 95 | |
| 96 | for text in output: |
| 97 | rich.print(text, end="") |
| 98 | |
| 99 | sys.exit(1) |
| 100 | |
| 101 | |
| 102 | main() |
no test coverage detected