Skip to content

Commit 406149e

Browse files
Enforce sorted architecture guard inventory in CONTRIBUTING
Co-authored-by: Shri Sukhani <shrisukhani@users.noreply.github.com>
1 parent 579184d commit 406149e

File tree

2 files changed

+23
-16
lines changed

2 files changed

+23
-16
lines changed

CONTRIBUTING.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -76,29 +76,29 @@ This runs lint, format checks, compile checks, tests, and package build.
7676
- Keep sync/async behavior in parity where applicable.
7777
- Prefer deterministic unit tests over network-dependent tests.
7878
- Preserve architectural guardrails with focused tests. Current guard suites include:
79+
- `tests/test_architecture_marker_usage.py` (architecture marker coverage across guard modules),
80+
- `tests/test_ci_workflow_quality_gates.py` (CI guard-stage + make-target enforcement),
81+
- `tests/test_computer_action_endpoint_helper_usage.py` (computer-action endpoint-normalization helper usage enforcement),
82+
- `tests/test_contributing_architecture_guard_listing.py` (`CONTRIBUTING.md` architecture-guard inventory completeness enforcement),
83+
- `tests/test_core_type_helper_usage.py` (core transport/config/header/file/polling/session/error/parsing manager+tool module enforcement of shared plain-type helper usage),
84+
- `tests/test_display_helper_usage.py` (display/key-format helper usage),
85+
- `tests/test_docs_python3_commands.py` (`README`/`CONTRIBUTING`/examples python3 command consistency enforcement),
86+
- `tests/test_example_run_instructions.py` (example run-instruction consistency enforcement),
87+
- `tests/test_example_sync_async_parity.py` (sync/async example parity enforcement),
88+
- `tests/test_examples_syntax.py` (example script syntax guardrail),
7989
- `tests/test_guardrail_ast_utils.py` (shared AST guard utility contract),
90+
- `tests/test_makefile_quality_targets.py` (Makefile quality-gate target enforcement),
8091
- `tests/test_manager_model_dump_usage.py` (manager serialization centralization),
81-
- `tests/test_mapping_reader_usage.py` (shared mapping-read parser usage),
8292
- `tests/test_mapping_keys_access_usage.py` (centralized key-iteration boundaries),
83-
- `tests/test_tool_mapping_reader_usage.py` (tools mapping-helper usage),
84-
- `tests/test_display_helper_usage.py` (display/key-format helper usage),
85-
- `tests/test_ci_workflow_quality_gates.py` (CI guard-stage + make-target enforcement),
86-
- `tests/test_makefile_quality_targets.py` (Makefile quality-gate target enforcement),
87-
- `tests/test_pyproject_architecture_marker.py` (pytest marker registration enforcement),
88-
- `tests/test_architecture_marker_usage.py` (architecture marker coverage across guard modules),
89-
- `tests/test_readme_examples_listing.py` (README example-listing consistency enforcement),
93+
- `tests/test_mapping_reader_usage.py` (shared mapping-read parser usage),
9094
- `tests/test_plain_type_guard_usage.py` (`str`/`int` guardrail enforcement via plain-type checks),
9195
- `tests/test_plain_type_identity_usage.py` (direct `type(... ) is str|int` guardrail enforcement via shared helpers),
92-
- `tests/test_type_utils_usage.py` (type `__mro__` boundary centralization in `hyperbrowser/type_utils.py`),
9396
- `tests/test_polling_loop_usage.py` (`while True` polling-loop centralization in `hyperbrowser/client/polling.py`),
94-
- `tests/test_core_type_helper_usage.py` (core transport/config/header/file/polling/session/error/parsing manager+tool module enforcement of shared plain-type helper usage),
95-
- `tests/test_contributing_architecture_guard_listing.py` (`CONTRIBUTING.md` architecture-guard inventory completeness enforcement),
96-
- `tests/test_examples_syntax.py` (example script syntax guardrail),
97-
- `tests/test_docs_python3_commands.py` (`README`/`CONTRIBUTING`/examples python3 command consistency enforcement),
98-
- `tests/test_example_sync_async_parity.py` (sync/async example parity enforcement),
99-
- `tests/test_example_run_instructions.py` (example run-instruction consistency enforcement),
100-
- `tests/test_computer_action_endpoint_helper_usage.py` (computer-action endpoint-normalization helper usage enforcement),
97+
- `tests/test_pyproject_architecture_marker.py` (pytest marker registration enforcement),
98+
- `tests/test_readme_examples_listing.py` (README example-listing consistency enforcement),
10199
- `tests/test_session_upload_helper_usage.py` (session upload-input normalization helper usage enforcement),
100+
- `tests/test_tool_mapping_reader_usage.py` (tools mapping-helper usage),
101+
- `tests/test_type_utils_usage.py` (type `__mro__` boundary centralization in `hyperbrowser/type_utils.py`),
102102
- `tests/test_web_payload_helper_usage.py` (web manager payload-helper usage enforcement).
103103

104104
## Code quality conventions

tests/test_contributing_architecture_guard_listing.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from pathlib import Path
2+
import re
23

34
import pytest
45

@@ -7,13 +8,19 @@
78

89
def test_contributing_lists_all_architecture_guard_modules():
910
contributing_text = Path("CONTRIBUTING.md").read_text(encoding="utf-8")
11+
listed_modules = re.findall(r"`(tests/test_[^`]+\.py)`", contributing_text)
12+
1013
architecture_modules: list[str] = []
1114
for module_path in sorted(Path("tests").glob("test_*.py")):
1215
module_text = module_path.read_text(encoding="utf-8")
1316
if "pytestmark = pytest.mark.architecture" not in module_text:
1417
continue
1518
architecture_modules.append(module_path.as_posix())
1619

20+
assert listed_modules != []
21+
assert listed_modules == sorted(listed_modules)
22+
assert listed_modules == architecture_modules
23+
1724
assert architecture_modules != []
1825
for module_path in architecture_modules:
1926
assert module_path in contributing_text

0 commit comments

Comments
 (0)