Skip to content

Commit 3272384

Browse files
Guard CONTRIBUTING architecture inventory completeness
Co-authored-by: Shri Sukhani <shrisukhani@users.noreply.github.com>
1 parent 76ebea3 commit 3272384

3 files changed

Lines changed: 22 additions & 1 deletion

File tree

CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ This runs lint, format checks, compile checks, tests, and package build.
9090
- `tests/test_plain_type_guard_usage.py` (`str`/`int` guardrail enforcement via plain-type checks),
9191
- `tests/test_type_utils_usage.py` (type `__mro__` boundary centralization in `hyperbrowser/type_utils.py`),
9292
- `tests/test_polling_loop_usage.py` (`while True` polling-loop centralization in `hyperbrowser/client/polling.py`),
93-
- `tests/test_core_type_helper_usage.py` (core transport/config/header/file/polling/session/error/parsing module enforcement of shared plain-type helper usage).
93+
- `tests/test_core_type_helper_usage.py` (core transport/config/header/file/polling/session/error/parsing module enforcement of shared plain-type helper usage),
94+
- `tests/test_contributing_architecture_guard_listing.py` (`CONTRIBUTING.md` architecture-guard inventory completeness enforcement).
9495

9596
## Code quality conventions
9697

tests/test_architecture_marker_usage.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"tests/test_type_utils_usage.py",
2121
"tests/test_polling_loop_usage.py",
2222
"tests/test_core_type_helper_usage.py",
23+
"tests/test_contributing_architecture_guard_listing.py",
2324
)
2425

2526

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from pathlib import Path
2+
3+
import pytest
4+
5+
pytestmark = pytest.mark.architecture
6+
7+
8+
def test_contributing_lists_all_architecture_guard_modules():
9+
contributing_text = Path("CONTRIBUTING.md").read_text(encoding="utf-8")
10+
architecture_modules: list[str] = []
11+
for module_path in sorted(Path("tests").glob("test_*.py")):
12+
module_text = module_path.read_text(encoding="utf-8")
13+
if "pytestmark = pytest.mark.architecture" not in module_text:
14+
continue
15+
architecture_modules.append(module_path.as_posix())
16+
17+
assert architecture_modules != []
18+
for module_path in architecture_modules:
19+
assert module_path in contributing_text

0 commit comments

Comments
 (0)