(argv: Sequence[str])
| 425 | |
| 426 | |
| 427 | def main(argv: Sequence[str]) -> int: |
| 428 | try: |
| 429 | _self_test() |
| 430 | except SelfTestFailure as error: |
| 431 | print(f"BLOCKED: network source audit self-test failed: {error}", file=sys.stderr) |
| 432 | return 1 |
| 433 | if len(argv) == 2 and argv[1] == "--self-test": |
| 434 | print("network source audit self-test: OK") |
| 435 | return 0 |
| 436 | if len(argv) != 3: |
| 437 | print(f"usage: {argv[0]} REPO_ROOT ALLOWLIST", file=sys.stderr) |
| 438 | return 2 |
| 439 | return _audit(pathlib.Path(argv[1]).resolve(), pathlib.Path(argv[2]).resolve()) |
| 440 | |
| 441 | |
| 442 | if __name__ == "__main__": |
no test coverage detected