test_guard_python.py¶
tests/guard/test_guard_python.py
Tests for Python ## doxygen comment support.
test_async_def_detected
test_guard_python.TestPythonFunctionDetection.test_async_def_detected(self)
tests/guard/test_guard_python.py:35
Checks
assert len(functions) == 1assert functions[0].name == "handler"assert functions[0].doxygen is not None
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-018 | measured | test_async_def_detected → parse_python → parse_lang → parse_functions |
| REQ-DDB-GUARD-019 | measured | test_async_def_detected → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → parse_doxygen_tags |
| REQ-DDB-GUARD-020 | measured | test_async_def_detected → parse_python → parse_lang → parse_functions → parse_functions_ts |
| REQ-DDB-GUARD-021 | inferred | test_async_def_detected → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → _find_python_docstring_block |
| REQ-DDB-GUARD-024 | inferred | test_async_def_detected → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _is_rust_test_item |
| REQ-DDB-GUARD-025 | measured | test_async_def_detected → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _js_returns_void |
Source · 13 lines
def test_async_def_detected(self):
content = dedent("""\
## @brief Async handler.
# @version 1.0
async def handler(event):
await process(event)
""")
functions = parse_python(content)
assert len(functions) == 1
assert functions[0].name == "handler"
assert functions[0].doxygen is not None
Activity · 5 steps
test_block_above_takes_precedence_over_docstring
test_guard_python.TestPythonDocstringTags.test_block_above_takes_precedence_over_docstring(self)
tests/guard/test_guard_python.py:289
Checks
assert len(functions) == 1assert dox is not Noneassert dox.tags["brief"] == ["Block-above wins."]assert dox.tags["version"] == ["2.0"]
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-018 | measured | test_block_above_takes_precedence_over_docstring → parse_python → parse_lang → parse_functions |
| REQ-DDB-GUARD-019 | measured | test_block_above_takes_precedence_over_docstring → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → parse_doxygen_tags |
| REQ-DDB-GUARD-020 | measured | test_block_above_takes_precedence_over_docstring → parse_python → parse_lang → parse_functions → parse_functions_ts |
| REQ-DDB-GUARD-021 | inferred | test_block_above_takes_precedence_over_docstring → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → _find_python_docstring_block |
| REQ-DDB-GUARD-024 | inferred | test_block_above_takes_precedence_over_docstring → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _is_rust_test_item |
| REQ-DDB-GUARD-025 | measured | test_block_above_takes_precedence_over_docstring → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _js_returns_void |
Source · 19 lines
def test_block_above_takes_precedence_over_docstring(self):
content = dedent('''\
## @brief Block-above wins.
# @version 2.0
def helper():
"""Body docstring.
@brief Should be ignored when block above exists.
@version 9.9
"""
return 1
''')
functions = parse_python(content)
assert len(functions) == 1
dox = functions[0].doxygen
assert dox is not None
assert dox.tags["brief"] == ["Block-above wins."]
assert dox.tags["version"] == ["2.0"]
Activity · 7 steps
test_class_level_block_does_not_leak_to_first_method
test_guard_python.TestFirstMemberDoxygen.test_class_level_block_does_not_leak_to_first_method(self, tmp_path)
The guard on the fix: stepping out must not adopt the class's own block.
tests/guard/test_guard_python.py:400
Checks
assert any("undocumented_first" in m for m in flagged)
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-CONFIG-001 | inferred | test_class_level_block_does_not_leak_to_first_method → _undocumented → validate_file → get_file_at_revision → run_git → git_argv |
| REQ-DDB-CONFIG-009 | measured | test_class_level_block_does_not_leak_to_first_method → _undocumented → validate_file → gate_exclusion |
| REQ-DDB-GUARD-001 | measured | test_class_level_block_does_not_leak_to_first_method → _undocumented → validate_file |
| REQ-DDB-GUARD-002 | inferred | test_class_level_block_does_not_leak_to_first_method → _undocumented → validate_file → check_version_staleness |
| REQ-DDB-GUARD-003 | measured | test_class_level_block_does_not_leak_to_first_method → _undocumented → validate_file → check_tags |
| REQ-DDB-GUARD-004 | measured | test_class_level_block_does_not_leak_to_first_method → _undocumented → validate_file → check_req_coverage |
| REQ-DDB-GUARD-005 | measured | test_class_level_block_does_not_leak_to_first_method → _undocumented → validate_file → check_return_presence |
| REQ-DDB-GUARD-006 | measured | test_class_level_block_does_not_leak_to_first_method → _undocumented → validate_file → check_file_presence |
| REQ-DDB-GUARD-007 | measured | test_class_level_block_does_not_leak_to_first_method → _undocumented → validate_file → check_duplicate_tags |
| REQ-DDB-GUARD-009 | inferred | test_class_level_block_does_not_leak_to_first_method → _undocumented → validate_file → check_req_coverage → _has_active_requirements → filter_requirements_by_version |
| REQ-DDB-GUARD-011 | inferred | test_class_level_block_does_not_leak_to_first_method → _undocumented → validate_file → check_req_coverage → _has_active_requirements → load_requirements_full |
| REQ-DDB-GUARD-013 | measured | test_class_level_block_does_not_leak_to_first_method → _undocumented → validate_file → unconfigured_language |
| REQ-DDB-GUARD-014 | inferred | test_class_level_block_does_not_leak_to_first_method → _undocumented → validate_file → check_req_coverage → _has_active_requirements → filter_requirements_by_version → parse_version |
| REQ-DDB-GUARD-016 | inferred | test_class_level_block_does_not_leak_to_first_method → _undocumented → validate_file → check_req_coverage → _has_active_requirements → filter_requirements_by_version → _summarise_id |
| REQ-DDB-GUARD-018 | measured | test_class_level_block_does_not_leak_to_first_method → _undocumented → validate_file → parse_source_file |
| REQ-DDB-GUARD-019 | measured | test_class_level_block_does_not_leak_to_first_method → _undocumented → validate_file → check_file_presence → _check_file_block_tags → parse_doxygen_tags |
| REQ-DDB-GUARD-020 | measured | test_class_level_block_does_not_leak_to_first_method → _undocumented → validate_file → parse_content_for_file → language_for_file |
| REQ-DDB-GUARD-021 | measured | test_class_level_block_does_not_leak_to_first_method → _undocumented → validate_file → parse_content_for_file → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → _find_python_docstring_block |
| REQ-DDB-GUARD-023 | inferred | test_class_level_block_does_not_leak_to_first_method → _undocumented → validate_file → get_file_at_revision |
| REQ-DDB-GUARD-024 | inferred | test_class_level_block_does_not_leak_to_first_method → _undocumented → validate_file → check_file_presence → _check_file_block_tags → apply_autobrief |
| REQ-DDB-GUARD-025 | measured | test_class_level_block_does_not_leak_to_first_method → _undocumented → validate_file → parse_content_for_file → parse_functions → parse_functions_ts → _collect_functions → _js_returns_void |
| REQ-DDB-GUARD-026 | measured | test_class_level_block_does_not_leak_to_first_method → _undocumented → validate_file → check_bus_tags |
| REQ-DDB-GUARD-027 | inferred | test_class_level_block_does_not_leak_to_first_method → _undocumented → validate_file → check_req_exists → _uncheckable |
| REQ-DDB-PIPE-011 | measured | test_class_level_block_does_not_leak_to_first_method → _undocumented → validate_file → gate_exclusion → binary_file |
| REQ-DDB-WIKI-054 | inferred | test_class_level_block_does_not_leak_to_first_method → _undocumented → validate_file → gate_exclusion → _gate_matcher → load_toolchain_config → _string_list → all |
Source · 14 lines
def test_class_level_block_does_not_leak_to_first_method(self, tmp_path):
"""The guard on the fix: stepping out must not adopt the class's own block."""
flagged = self._undocumented(
tmp_path,
"""\
## @brief Doc for the class itself.
# @version 9.9
class Thing:
def undocumented_first(self):
pass
""",
)
assert any("undocumented_first" in m for m in flagged)
Activity · 2 steps
test_custom_tag_single_line
test_guard_python.TestPythonDoxygenBlocks.test_custom_tag_single_line(self)
tests/guard/test_guard_python.py:133
Checks
assert len(functions) == 1assert tags["brief"] == ["Func."]assert tags["mycustomtag"] == ["some-value"]
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-018 | measured | test_custom_tag_single_line → parse_python → parse_lang → parse_functions |
| REQ-DDB-GUARD-019 | measured | test_custom_tag_single_line → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → parse_doxygen_tags |
| REQ-DDB-GUARD-020 | measured | test_custom_tag_single_line → parse_python → parse_lang → parse_functions → parse_functions_ts |
| REQ-DDB-GUARD-021 | inferred | test_custom_tag_single_line → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → _find_python_docstring_block |
| REQ-DDB-GUARD-024 | inferred | test_custom_tag_single_line → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _is_rust_test_item |
| REQ-DDB-GUARD-025 | measured | test_custom_tag_single_line → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _js_returns_void |
Source · 13 lines
def test_custom_tag_single_line(self):
content = dedent("""\
## @brief Func. @mycustomtag some-value
def func():
pass
""")
functions = parse_python(content)
assert len(functions) == 1
tags = functions[0].doxygen.tags
assert tags["brief"] == ["Func."]
assert tags["mycustomtag"] == ["some-value"]
Activity · 6 steps
test_docstring_satisfies_req_tag
test_guard_python.TestPythonDocstringTags.test_docstring_satisfies_req_tag(self, tmp_path)
tests/guard/test_guard_python.py:321
Checks
assert violations == []
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-CONFIG-001 | inferred | test_docstring_satisfies_req_tag → validate_file → get_file_at_revision → run_git → git_argv |
| REQ-DDB-CONFIG-009 | measured | test_docstring_satisfies_req_tag → validate_file → gate_exclusion |
| REQ-DDB-GUARD-001 | measured | test_docstring_satisfies_req_tag → validate_file |
| REQ-DDB-GUARD-002 | inferred | test_docstring_satisfies_req_tag → validate_file → check_version_staleness |
| REQ-DDB-GUARD-003 | measured | test_docstring_satisfies_req_tag → validate_file → check_tags |
| REQ-DDB-GUARD-004 | measured | test_docstring_satisfies_req_tag → validate_file → check_req_coverage |
| REQ-DDB-GUARD-005 | measured | test_docstring_satisfies_req_tag → validate_file → check_return_presence |
| REQ-DDB-GUARD-006 | measured | test_docstring_satisfies_req_tag → validate_file → check_file_presence |
| REQ-DDB-GUARD-007 | measured | test_docstring_satisfies_req_tag → validate_file → check_duplicate_tags |
| REQ-DDB-GUARD-009 | inferred | test_docstring_satisfies_req_tag → validate_file → check_req_coverage → _has_active_requirements → filter_requirements_by_version |
| REQ-DDB-GUARD-011 | inferred | test_docstring_satisfies_req_tag → validate_file → check_req_coverage → _has_active_requirements → load_requirements_full |
| REQ-DDB-GUARD-013 | measured | test_docstring_satisfies_req_tag → validate_file → unconfigured_language |
| REQ-DDB-GUARD-014 | inferred | test_docstring_satisfies_req_tag → validate_file → check_req_coverage → _has_active_requirements → filter_requirements_by_version → parse_version |
| REQ-DDB-GUARD-016 | inferred | test_docstring_satisfies_req_tag → validate_file → check_req_coverage → _has_active_requirements → filter_requirements_by_version → _summarise_id |
| REQ-DDB-GUARD-018 | measured | test_docstring_satisfies_req_tag → validate_file → parse_source_file |
| REQ-DDB-GUARD-019 | measured | test_docstring_satisfies_req_tag → validate_file → check_file_presence → _check_file_block_tags → parse_doxygen_tags |
| REQ-DDB-GUARD-020 | measured | test_docstring_satisfies_req_tag → validate_file → parse_content_for_file → language_for_file |
| REQ-DDB-GUARD-021 | measured | test_docstring_satisfies_req_tag → validate_file → parse_content_for_file → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → _find_python_docstring_block |
| REQ-DDB-GUARD-023 | inferred | test_docstring_satisfies_req_tag → validate_file → get_file_at_revision |
| REQ-DDB-GUARD-024 | measured | test_docstring_satisfies_req_tag → validate_file → check_file_presence → _check_file_block_tags → apply_autobrief |
| REQ-DDB-GUARD-025 | measured | test_docstring_satisfies_req_tag → validate_file → parse_content_for_file → parse_functions → parse_functions_ts → _collect_functions → _js_returns_void |
| REQ-DDB-GUARD-026 | measured | test_docstring_satisfies_req_tag → validate_file → check_bus_tags |
| REQ-DDB-GUARD-027 | inferred | test_docstring_satisfies_req_tag → validate_file → check_req_exists → _uncheckable |
| REQ-DDB-PIPE-011 | measured | test_docstring_satisfies_req_tag → validate_file → gate_exclusion → binary_file |
| REQ-DDB-WIKI-054 | inferred | test_docstring_satisfies_req_tag → validate_file → gate_exclusion → _gate_matcher → load_toolchain_config → _string_list → all |
Source · 18 lines
def test_docstring_satisfies_req_tag(self, tmp_path):
py_file = tmp_path / "doc.py"
py_file.write_text(
dedent('''\
def handle() -> None:
"""Handler.
@brief Event handler.
@version 1.0
@req REQ-PY-001
"""
pass
'''),
)
violations = validate_file(str(py_file), CONFIG_DEFAULTS, no_git=True)
assert violations == []
Activity · 4 steps
test_docstring_tags_satisfy_presence
test_guard_python.TestPythonDocstringTags.test_docstring_tags_satisfy_presence(self, tmp_path)
tests/guard/test_guard_python.py:228
Checks
assert violations == [], f"expected clean run, got: {[str(v) for v in violations]}"
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-CONFIG-001 | inferred | test_docstring_tags_satisfy_presence → validate_file → get_file_at_revision → run_git → git_argv |
| REQ-DDB-CONFIG-009 | measured | test_docstring_tags_satisfy_presence → validate_file → gate_exclusion |
| REQ-DDB-GUARD-001 | measured | test_docstring_tags_satisfy_presence → validate_file |
| REQ-DDB-GUARD-002 | inferred | test_docstring_tags_satisfy_presence → validate_file → check_version_staleness |
| REQ-DDB-GUARD-003 | measured | test_docstring_tags_satisfy_presence → validate_file → check_tags |
| REQ-DDB-GUARD-004 | measured | test_docstring_tags_satisfy_presence → validate_file → check_req_coverage |
| REQ-DDB-GUARD-005 | measured | test_docstring_tags_satisfy_presence → validate_file → check_return_presence |
| REQ-DDB-GUARD-006 | measured | test_docstring_tags_satisfy_presence → validate_file → check_file_presence |
| REQ-DDB-GUARD-007 | measured | test_docstring_tags_satisfy_presence → validate_file → check_duplicate_tags |
| REQ-DDB-GUARD-009 | inferred | test_docstring_tags_satisfy_presence → validate_file → check_req_coverage → _has_active_requirements → filter_requirements_by_version |
| REQ-DDB-GUARD-011 | inferred | test_docstring_tags_satisfy_presence → validate_file → check_req_coverage → _has_active_requirements → load_requirements_full |
| REQ-DDB-GUARD-013 | measured | test_docstring_tags_satisfy_presence → validate_file → unconfigured_language |
| REQ-DDB-GUARD-014 | inferred | test_docstring_tags_satisfy_presence → validate_file → check_req_coverage → _has_active_requirements → filter_requirements_by_version → parse_version |
| REQ-DDB-GUARD-016 | inferred | test_docstring_tags_satisfy_presence → validate_file → check_req_coverage → _has_active_requirements → filter_requirements_by_version → _summarise_id |
| REQ-DDB-GUARD-018 | measured | test_docstring_tags_satisfy_presence → validate_file → parse_source_file |
| REQ-DDB-GUARD-019 | measured | test_docstring_tags_satisfy_presence → validate_file → check_file_presence → _check_file_block_tags → parse_doxygen_tags |
| REQ-DDB-GUARD-020 | measured | test_docstring_tags_satisfy_presence → validate_file → parse_content_for_file → language_for_file |
| REQ-DDB-GUARD-021 | measured | test_docstring_tags_satisfy_presence → validate_file → parse_content_for_file → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → _find_python_docstring_block |
| REQ-DDB-GUARD-023 | inferred | test_docstring_tags_satisfy_presence → validate_file → get_file_at_revision |
| REQ-DDB-GUARD-024 | measured | test_docstring_tags_satisfy_presence → validate_file → check_file_presence → _check_file_block_tags → apply_autobrief |
| REQ-DDB-GUARD-025 | measured | test_docstring_tags_satisfy_presence → validate_file → parse_content_for_file → parse_functions → parse_functions_ts → _collect_functions → _js_returns_void |
| REQ-DDB-GUARD-026 | measured | test_docstring_tags_satisfy_presence → validate_file → check_bus_tags |
| REQ-DDB-GUARD-027 | inferred | test_docstring_tags_satisfy_presence → validate_file → check_req_exists → _uncheckable |
| REQ-DDB-PIPE-011 | measured | test_docstring_tags_satisfy_presence → validate_file → gate_exclusion → binary_file |
| REQ-DDB-WIKI-054 | inferred | test_docstring_tags_satisfy_presence → validate_file → gate_exclusion → _gate_matcher → load_toolchain_config → _string_list → all |
Source · 17 lines
def test_docstring_tags_satisfy_presence(self, tmp_path):
py_file = tmp_path / "doc.py"
py_file.write_text(
dedent('''\
def apply_patch(path: str) -> int:
"""Apply a unified-diff patch.
@brief Apply a unified-diff patch to a project directory.
@version 1.0
@return 0 on success.
"""
return 0
'''),
)
violations = validate_file(str(py_file), CONFIG_DEFAULTS, no_git=True)
assert violations == [], f"expected clean run, got: {[str(v) for v in violations]}"
Activity · 4 steps
test_docstring_tags_via_regex_parser
test_guard_python.TestPythonDocstringTags.test_docstring_tags_via_regex_parser(self)
tests/guard/test_guard_python.py:245
Checks
assert len(functions) == 1assert dox is not Noneassert dox.tags["brief"] == ["Helper function."]assert dox.tags["version"] == ["1.2"]assert "return" in dox.tags
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-018 | measured | test_docstring_tags_via_regex_parser → parse_python → parse_lang → parse_functions |
| REQ-DDB-GUARD-019 | measured | test_docstring_tags_via_regex_parser → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → parse_doxygen_tags |
| REQ-DDB-GUARD-020 | measured | test_docstring_tags_via_regex_parser → parse_python → parse_lang → parse_functions → parse_functions_ts |
| REQ-DDB-GUARD-021 | measured | test_docstring_tags_via_regex_parser → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → _find_python_docstring_block |
| REQ-DDB-GUARD-024 | measured | test_docstring_tags_via_regex_parser → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _is_rust_test_item |
| REQ-DDB-GUARD-025 | measured | test_docstring_tags_via_regex_parser → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _js_returns_void |
Source · 19 lines
def test_docstring_tags_via_regex_parser(self):
content = dedent('''\
def helper(x: int) -> int:
"""Short summary.
@brief Helper function.
@version 1.2
@return Doubled value.
"""
return x * 2
''')
functions = parse_python(content)
assert len(functions) == 1
dox = functions[0].doxygen
assert dox is not None
assert dox.tags["brief"] == ["Helper function."]
assert dox.tags["version"] == ["1.2"]
assert "return" in dox.tags
Activity · 8 steps
test_doxygen_associated_correctly
test_guard_python.TestPythonDoxygenBlocks.test_doxygen_associated_correctly(self)
tests/guard/test_guard_python.py:51
Checks
assert by_name["init_system"].doxygen is not Noneassert "brief" in by_name["init_system"].doxygen.tagsassert "version" in by_name["init_system"].doxygen.tagsassert by_name["process_data"].doxygen is not Noneassert by_name["handle_event"].doxygen is not Noneassert "req" in by_name["handle_event"].doxygen.tags
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-018 | measured | test_doxygen_associated_correctly → parse_python → parse_lang → parse_functions |
| REQ-DDB-GUARD-019 | measured | test_doxygen_associated_correctly → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → parse_doxygen_tags |
| REQ-DDB-GUARD-020 | measured | test_doxygen_associated_correctly → parse_python → parse_lang → parse_functions → parse_functions_ts |
| REQ-DDB-GUARD-021 | measured | test_doxygen_associated_correctly → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → _find_python_docstring_block |
| REQ-DDB-GUARD-024 | inferred | test_doxygen_associated_correctly → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _is_rust_test_item |
| REQ-DDB-GUARD-025 | measured | test_doxygen_associated_correctly → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _js_returns_void |
Source · 13 lines
def test_doxygen_associated_correctly(self):
content = (FIXTURES_DIR / "python_simple.py").read_text()
functions = parse_python(content)
by_name = {f.name: f for f in functions}
assert by_name["init_system"].doxygen is not None
assert "brief" in by_name["init_system"].doxygen.tags
assert "version" in by_name["init_system"].doxygen.tags
assert by_name["process_data"].doxygen is not None
assert by_name["handle_event"].doxygen is not None
assert "req" in by_name["handle_event"].doxygen.tags
Activity · 9 steps
test_empty_docstring_is_not_a_block
test_guard_python.TestPythonDocstringTags.test_empty_docstring_is_not_a_block(self)
tests/guard/test_guard_python.py:281
Checks
assert parse_python(content)[0].doxygen is None
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-018 | measured | test_empty_docstring_is_not_a_block → parse_python → parse_lang → parse_functions |
| REQ-DDB-GUARD-019 | measured | test_empty_docstring_is_not_a_block → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → parse_doxygen_tags |
| REQ-DDB-GUARD-020 | measured | test_empty_docstring_is_not_a_block → parse_python → parse_lang → parse_functions → parse_functions_ts |
| REQ-DDB-GUARD-021 | measured | test_empty_docstring_is_not_a_block → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → _find_python_docstring_block |
| REQ-DDB-GUARD-024 | inferred | test_empty_docstring_is_not_a_block → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _is_rust_test_item |
| REQ-DDB-GUARD-025 | measured | test_empty_docstring_is_not_a_block → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _js_returns_void |
Source · 8 lines
def test_empty_docstring_is_not_a_block(self):
content = dedent('''\
def helper():
""""""
return 1
''')
assert parse_python(content)[0].doxygen is None
Activity · 2 steps
test_file_tag_in_prose_does_not_suppress_the_block
test_guard_python.TestFirstMemberDoxygen.test_file_tag_in_prose_does_not_suppress_the_block(self, tmp_path)
Only a real
tests/guard/test_guard_python.py:448
Checks
assert work.doxygen is not Noneassert work.doxygen.tags["version"] == ["1.0"]
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-018 | measured | test_file_tag_in_prose_does_not_suppress_the_block → parse_python → parse_lang → parse_functions |
| REQ-DDB-GUARD-019 | measured | test_file_tag_in_prose_does_not_suppress_the_block → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → parse_doxygen_tags |
| REQ-DDB-GUARD-020 | measured | test_file_tag_in_prose_does_not_suppress_the_block → parse_python → parse_lang → parse_functions → parse_functions_ts |
| REQ-DDB-GUARD-021 | inferred | test_file_tag_in_prose_does_not_suppress_the_block → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → _find_python_docstring_block |
| REQ-DDB-GUARD-024 | inferred | test_file_tag_in_prose_does_not_suppress_the_block → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _is_rust_test_item |
| REQ-DDB-GUARD-025 | measured | test_file_tag_in_prose_does_not_suppress_the_block → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _js_returns_void |
Source · 20 lines
def test_file_tag_in_prose_does_not_suppress_the_block(self, tmp_path):
"""Only a real @file tag marks a block file-level, not a prose mention.
Caught by this repo's own gate while implementing the fix:
_collect_python_comments describes the file-tag rule in its own @details prose,
and an unanchored match discarded that function's doxygen block entirely.
"""
py_file = tmp_path / "m.py"
py_file.write_text(
dedent("""\
## @brief Handle a header that declares @file itself.
# @version 1.0
# @return zero
def work() -> int:
return 0
""")
)
work = next(f for f in parse_python(py_file.read_text()) if f.name == "work")
assert work.doxygen is not None
assert work.doxygen.tags["version"] == ["1.0"]1 more lines, not shown
Activity · 5 steps
test_finds_all_functions
test_guard_python.TestPythonFunctionDetection.test_finds_all_functions(self)
tests/guard/test_guard_python.py:23
Checks
assert "init_system" in namesassert "process_data" in namesassert "undocumented_function" in namesassert "handle_event" in namesassert "__init__" in namesassert "get_value" in namesassert "undocumented_method" in names
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-018 | measured | test_finds_all_functions → parse_python → parse_lang → parse_functions |
| REQ-DDB-GUARD-019 | measured | test_finds_all_functions → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → parse_doxygen_tags |
| REQ-DDB-GUARD-020 | measured | test_finds_all_functions → parse_python → parse_lang → parse_functions → parse_functions_ts |
| REQ-DDB-GUARD-021 | measured | test_finds_all_functions → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → _find_python_docstring_block |
| REQ-DDB-GUARD-024 | inferred | test_finds_all_functions → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _is_rust_test_item |
| REQ-DDB-GUARD-025 | measured | test_finds_all_functions → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _js_returns_void |
Source · 12 lines
def test_finds_all_functions(self):
content = (FIXTURES_DIR / "python_simple.py").read_text()
functions = parse_python(content)
names = [f.name for f in functions]
assert "init_system" in names
assert "process_data" in names
assert "undocumented_function" in names
assert "handle_event" in names
assert "__init__" in names
assert "get_value" in names
assert "undocumented_method" in names
Activity · 10 steps
test_first_method_after_class_docstring_still_found
test_guard_python.TestFirstMemberDoxygen.test_first_method_after_class_docstring_still_found(self, tmp_path)
tests/guard/test_guard_python.py:385
Checks
assert flagged == []
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-CONFIG-001 | inferred | test_first_method_after_class_docstring_still_found → _undocumented → validate_file → get_file_at_revision → run_git → git_argv |
| REQ-DDB-CONFIG-009 | measured | test_first_method_after_class_docstring_still_found → _undocumented → validate_file → gate_exclusion |
| REQ-DDB-GUARD-001 | measured | test_first_method_after_class_docstring_still_found → _undocumented → validate_file |
| REQ-DDB-GUARD-002 | inferred | test_first_method_after_class_docstring_still_found → _undocumented → validate_file → check_version_staleness |
| REQ-DDB-GUARD-003 | measured | test_first_method_after_class_docstring_still_found → _undocumented → validate_file → check_tags |
| REQ-DDB-GUARD-004 | measured | test_first_method_after_class_docstring_still_found → _undocumented → validate_file → check_req_coverage |
| REQ-DDB-GUARD-005 | measured | test_first_method_after_class_docstring_still_found → _undocumented → validate_file → check_return_presence |
| REQ-DDB-GUARD-006 | measured | test_first_method_after_class_docstring_still_found → _undocumented → validate_file → check_file_presence |
| REQ-DDB-GUARD-007 | measured | test_first_method_after_class_docstring_still_found → _undocumented → validate_file → check_duplicate_tags |
| REQ-DDB-GUARD-009 | inferred | test_first_method_after_class_docstring_still_found → _undocumented → validate_file → check_req_coverage → _has_active_requirements → filter_requirements_by_version |
| REQ-DDB-GUARD-011 | inferred | test_first_method_after_class_docstring_still_found → _undocumented → validate_file → check_req_coverage → _has_active_requirements → load_requirements_full |
| REQ-DDB-GUARD-013 | measured | test_first_method_after_class_docstring_still_found → _undocumented → validate_file → unconfigured_language |
| REQ-DDB-GUARD-014 | inferred | test_first_method_after_class_docstring_still_found → _undocumented → validate_file → check_req_coverage → _has_active_requirements → filter_requirements_by_version → parse_version |
| REQ-DDB-GUARD-016 | inferred | test_first_method_after_class_docstring_still_found → _undocumented → validate_file → check_req_coverage → _has_active_requirements → filter_requirements_by_version → _summarise_id |
| REQ-DDB-GUARD-018 | measured | test_first_method_after_class_docstring_still_found → _undocumented → validate_file → parse_source_file |
| REQ-DDB-GUARD-019 | measured | test_first_method_after_class_docstring_still_found → _undocumented → validate_file → check_file_presence → _check_file_block_tags → parse_doxygen_tags |
| REQ-DDB-GUARD-020 | measured | test_first_method_after_class_docstring_still_found → _undocumented → validate_file → parse_content_for_file → language_for_file |
| REQ-DDB-GUARD-021 | inferred | test_first_method_after_class_docstring_still_found → _undocumented → validate_file → parse_content_for_file → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → _find_python_docstring_block |
| REQ-DDB-GUARD-023 | inferred | test_first_method_after_class_docstring_still_found → _undocumented → validate_file → get_file_at_revision |
| REQ-DDB-GUARD-024 | inferred | test_first_method_after_class_docstring_still_found → _undocumented → validate_file → check_file_presence → _check_file_block_tags → apply_autobrief |
| REQ-DDB-GUARD-025 | measured | test_first_method_after_class_docstring_still_found → _undocumented → validate_file → parse_content_for_file → parse_functions → parse_functions_ts → _collect_functions → _js_returns_void |
| REQ-DDB-GUARD-026 | measured | test_first_method_after_class_docstring_still_found → _undocumented → validate_file → check_bus_tags |
| REQ-DDB-GUARD-027 | inferred | test_first_method_after_class_docstring_still_found → _undocumented → validate_file → check_req_exists → _uncheckable |
| REQ-DDB-PIPE-011 | measured | test_first_method_after_class_docstring_still_found → _undocumented → validate_file → gate_exclusion → binary_file |
| REQ-DDB-WIKI-054 | inferred | test_first_method_after_class_docstring_still_found → _undocumented → validate_file → gate_exclusion → _gate_matcher → load_toolchain_config → _string_list → all |
Source · 15 lines
def test_first_method_after_class_docstring_still_found(self, tmp_path):
flagged = self._undocumented(
tmp_path,
'''\
class Thing:
"""Class docstring."""
## @brief First method.
# @version 1.0
def alpha(self):
pass
''',
)
assert flagged == []
Activity · 2 steps
test_first_method_directly_after_class_line
test_guard_python.TestFirstMemberDoxygen.test_first_method_directly_after_class_line(self, tmp_path)
tests/guard/test_guard_python.py:354
Checks
assert flagged == []
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-CONFIG-001 | inferred | test_first_method_directly_after_class_line → _undocumented → validate_file → get_file_at_revision → run_git → git_argv |
| REQ-DDB-CONFIG-009 | measured | test_first_method_directly_after_class_line → _undocumented → validate_file → gate_exclusion |
| REQ-DDB-GUARD-001 | measured | test_first_method_directly_after_class_line → _undocumented → validate_file |
| REQ-DDB-GUARD-002 | inferred | test_first_method_directly_after_class_line → _undocumented → validate_file → check_version_staleness |
| REQ-DDB-GUARD-003 | measured | test_first_method_directly_after_class_line → _undocumented → validate_file → check_tags |
| REQ-DDB-GUARD-004 | measured | test_first_method_directly_after_class_line → _undocumented → validate_file → check_req_coverage |
| REQ-DDB-GUARD-005 | measured | test_first_method_directly_after_class_line → _undocumented → validate_file → check_return_presence |
| REQ-DDB-GUARD-006 | measured | test_first_method_directly_after_class_line → _undocumented → validate_file → check_file_presence |
| REQ-DDB-GUARD-007 | measured | test_first_method_directly_after_class_line → _undocumented → validate_file → check_duplicate_tags |
| REQ-DDB-GUARD-009 | inferred | test_first_method_directly_after_class_line → _undocumented → validate_file → check_req_coverage → _has_active_requirements → filter_requirements_by_version |
| REQ-DDB-GUARD-011 | inferred | test_first_method_directly_after_class_line → _undocumented → validate_file → check_req_coverage → _has_active_requirements → load_requirements_full |
| REQ-DDB-GUARD-013 | measured | test_first_method_directly_after_class_line → _undocumented → validate_file → unconfigured_language |
| REQ-DDB-GUARD-014 | inferred | test_first_method_directly_after_class_line → _undocumented → validate_file → check_req_coverage → _has_active_requirements → filter_requirements_by_version → parse_version |
| REQ-DDB-GUARD-016 | inferred | test_first_method_directly_after_class_line → _undocumented → validate_file → check_req_coverage → _has_active_requirements → filter_requirements_by_version → _summarise_id |
| REQ-DDB-GUARD-018 | measured | test_first_method_directly_after_class_line → _undocumented → validate_file → parse_source_file |
| REQ-DDB-GUARD-019 | measured | test_first_method_directly_after_class_line → _undocumented → validate_file → check_file_presence → _check_file_block_tags → parse_doxygen_tags |
| REQ-DDB-GUARD-020 | measured | test_first_method_directly_after_class_line → _undocumented → validate_file → parse_content_for_file → language_for_file |
| REQ-DDB-GUARD-021 | inferred | test_first_method_directly_after_class_line → _undocumented → validate_file → parse_content_for_file → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → _find_python_docstring_block |
| REQ-DDB-GUARD-023 | inferred | test_first_method_directly_after_class_line → _undocumented → validate_file → get_file_at_revision |
| REQ-DDB-GUARD-024 | inferred | test_first_method_directly_after_class_line → _undocumented → validate_file → check_file_presence → _check_file_block_tags → apply_autobrief |
| REQ-DDB-GUARD-025 | measured | test_first_method_directly_after_class_line → _undocumented → validate_file → parse_content_for_file → parse_functions → parse_functions_ts → _collect_functions → _js_returns_void |
| REQ-DDB-GUARD-026 | measured | test_first_method_directly_after_class_line → _undocumented → validate_file → check_bus_tags |
| REQ-DDB-GUARD-027 | inferred | test_first_method_directly_after_class_line → _undocumented → validate_file → check_req_exists → _uncheckable |
| REQ-DDB-PIPE-011 | measured | test_first_method_directly_after_class_line → _undocumented → validate_file → gate_exclusion → binary_file |
| REQ-DDB-WIKI-054 | inferred | test_first_method_directly_after_class_line → _undocumented → validate_file → gate_exclusion → _gate_matcher → load_toolchain_config → _string_list → all |
Source · 13 lines
def test_first_method_directly_after_class_line(self, tmp_path):
flagged = self._undocumented(
tmp_path,
"""\
class Thing:
## @brief First method.
# @version 1.0
def alpha(self):
pass
""",
)
assert flagged == []
Activity · 2 steps
test_first_method_version_is_its_own
test_guard_python.TestFirstMemberDoxygen.test_first_method_version_is_its_own(self, tmp_path)
Beyond presence: the tags must come from the method's block, not elsewhere.
tests/guard/test_guard_python.py:428
Checks
assert alpha.doxygen is not Noneassert alpha.doxygen.tags["version"] == ["2.5"]assert alpha.doxygen.tags["brief"] == ["Method block."]
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-018 | measured | test_first_method_version_is_its_own → parse_python → parse_lang → parse_functions |
| REQ-DDB-GUARD-019 | measured | test_first_method_version_is_its_own → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → parse_doxygen_tags |
| REQ-DDB-GUARD-020 | measured | test_first_method_version_is_its_own → parse_python → parse_lang → parse_functions → parse_functions_ts |
| REQ-DDB-GUARD-021 | inferred | test_first_method_version_is_its_own → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → _find_python_docstring_block |
| REQ-DDB-GUARD-024 | inferred | test_first_method_version_is_its_own → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _is_rust_test_item |
| REQ-DDB-GUARD-025 | measured | test_first_method_version_is_its_own → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _js_returns_void |
Source · 20 lines
def test_first_method_version_is_its_own(self, tmp_path):
"""Beyond presence: the tags must come from the method's block, not elsewhere."""
py_file = tmp_path / "sample.py"
py_file.write_text(
dedent("""\
## @brief Class block.
# @version 9.9
class Thing:
## @brief Method block.
# @version 2.5
def alpha(self):
pass
""")
)
functions = parse_python(py_file.read_text())
alpha = next(f for f in functions if f.name == "alpha")
assert alpha.doxygen is not None
assert alpha.doxygen.tags["version"] == ["2.5"]
assert alpha.doxygen.tags["brief"] == ["Method block."]
Activity · 7 steps
test_fully_documented_python
test_guard_python.TestPythonPresenceCheck.test_fully_documented_python(self, tmp_path)
tests/guard/test_guard_python.py:160
Checks
assert violations == []
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-CONFIG-001 | inferred | test_fully_documented_python → validate_file → get_file_at_revision → run_git → git_argv |
| REQ-DDB-CONFIG-009 | measured | test_fully_documented_python → validate_file → gate_exclusion |
| REQ-DDB-GUARD-001 | measured | test_fully_documented_python → validate_file |
| REQ-DDB-GUARD-002 | inferred | test_fully_documented_python → validate_file → check_version_staleness |
| REQ-DDB-GUARD-003 | measured | test_fully_documented_python → validate_file → check_tags |
| REQ-DDB-GUARD-004 | measured | test_fully_documented_python → validate_file → check_req_coverage |
| REQ-DDB-GUARD-005 | measured | test_fully_documented_python → validate_file → check_return_presence |
| REQ-DDB-GUARD-006 | measured | test_fully_documented_python → validate_file → check_file_presence |
| REQ-DDB-GUARD-007 | measured | test_fully_documented_python → validate_file → check_duplicate_tags |
| REQ-DDB-GUARD-009 | inferred | test_fully_documented_python → validate_file → check_req_coverage → _has_active_requirements → filter_requirements_by_version |
| REQ-DDB-GUARD-011 | inferred | test_fully_documented_python → validate_file → check_req_coverage → _has_active_requirements → load_requirements_full |
| REQ-DDB-GUARD-013 | measured | test_fully_documented_python → validate_file → unconfigured_language |
| REQ-DDB-GUARD-014 | inferred | test_fully_documented_python → validate_file → check_req_coverage → _has_active_requirements → filter_requirements_by_version → parse_version |
| REQ-DDB-GUARD-016 | inferred | test_fully_documented_python → validate_file → check_req_coverage → _has_active_requirements → filter_requirements_by_version → _summarise_id |
| REQ-DDB-GUARD-018 | measured | test_fully_documented_python → validate_file → parse_source_file |
| REQ-DDB-GUARD-019 | measured | test_fully_documented_python → validate_file → check_file_presence → _check_file_block_tags → parse_doxygen_tags |
| REQ-DDB-GUARD-020 | measured | test_fully_documented_python → validate_file → parse_content_for_file → language_for_file |
| REQ-DDB-GUARD-021 | inferred | test_fully_documented_python → validate_file → parse_content_for_file → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → _find_python_docstring_block |
| REQ-DDB-GUARD-023 | inferred | test_fully_documented_python → validate_file → get_file_at_revision |
| REQ-DDB-GUARD-024 | inferred | test_fully_documented_python → validate_file → check_file_presence → _check_file_block_tags → apply_autobrief |
| REQ-DDB-GUARD-025 | measured | test_fully_documented_python → validate_file → parse_content_for_file → parse_functions → parse_functions_ts → _collect_functions → _js_returns_void |
| REQ-DDB-GUARD-026 | measured | test_fully_documented_python → validate_file → check_bus_tags |
| REQ-DDB-GUARD-027 | inferred | test_fully_documented_python → validate_file → check_req_exists → _uncheckable |
| REQ-DDB-PIPE-011 | measured | test_fully_documented_python → validate_file → gate_exclusion → binary_file |
| REQ-DDB-WIKI-054 | inferred | test_fully_documented_python → validate_file → gate_exclusion → _gate_matcher → load_toolchain_config → _string_list → all |
Source · 13 lines
def test_fully_documented_python(self, tmp_path):
py_file = tmp_path / "clean.py"
py_file.write_text(
dedent("""\
## @brief Do work.
# @version 1.0
def do_work():
pass
""")
)
violations = validate_file(str(py_file), CONFIG_DEFAULTS, no_git=True)
assert violations == []
Activity · 4 steps
test_later_method_still_found
test_guard_python.TestFirstMemberDoxygen.test_later_method_still_found(self, tmp_path)
tests/guard/test_guard_python.py:367
Checks
assert flagged == []
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-CONFIG-001 | inferred | test_later_method_still_found → _undocumented → validate_file → get_file_at_revision → run_git → git_argv |
| REQ-DDB-CONFIG-009 | measured | test_later_method_still_found → _undocumented → validate_file → gate_exclusion |
| REQ-DDB-GUARD-001 | measured | test_later_method_still_found → _undocumented → validate_file |
| REQ-DDB-GUARD-002 | inferred | test_later_method_still_found → _undocumented → validate_file → check_version_staleness |
| REQ-DDB-GUARD-003 | measured | test_later_method_still_found → _undocumented → validate_file → check_tags |
| REQ-DDB-GUARD-004 | measured | test_later_method_still_found → _undocumented → validate_file → check_req_coverage |
| REQ-DDB-GUARD-005 | measured | test_later_method_still_found → _undocumented → validate_file → check_return_presence |
| REQ-DDB-GUARD-006 | measured | test_later_method_still_found → _undocumented → validate_file → check_file_presence |
| REQ-DDB-GUARD-007 | measured | test_later_method_still_found → _undocumented → validate_file → check_duplicate_tags |
| REQ-DDB-GUARD-009 | inferred | test_later_method_still_found → _undocumented → validate_file → check_req_coverage → _has_active_requirements → filter_requirements_by_version |
| REQ-DDB-GUARD-011 | inferred | test_later_method_still_found → _undocumented → validate_file → check_req_coverage → _has_active_requirements → load_requirements_full |
| REQ-DDB-GUARD-013 | measured | test_later_method_still_found → _undocumented → validate_file → unconfigured_language |
| REQ-DDB-GUARD-014 | inferred | test_later_method_still_found → _undocumented → validate_file → check_req_coverage → _has_active_requirements → filter_requirements_by_version → parse_version |
| REQ-DDB-GUARD-016 | inferred | test_later_method_still_found → _undocumented → validate_file → check_req_coverage → _has_active_requirements → filter_requirements_by_version → _summarise_id |
| REQ-DDB-GUARD-018 | measured | test_later_method_still_found → _undocumented → validate_file → parse_source_file |
| REQ-DDB-GUARD-019 | measured | test_later_method_still_found → _undocumented → validate_file → check_file_presence → _check_file_block_tags → parse_doxygen_tags |
| REQ-DDB-GUARD-020 | measured | test_later_method_still_found → _undocumented → validate_file → parse_content_for_file → language_for_file |
| REQ-DDB-GUARD-021 | inferred | test_later_method_still_found → _undocumented → validate_file → parse_content_for_file → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → _find_python_docstring_block |
| REQ-DDB-GUARD-023 | inferred | test_later_method_still_found → _undocumented → validate_file → get_file_at_revision |
| REQ-DDB-GUARD-024 | inferred | test_later_method_still_found → _undocumented → validate_file → check_file_presence → _check_file_block_tags → apply_autobrief |
| REQ-DDB-GUARD-025 | measured | test_later_method_still_found → _undocumented → validate_file → parse_content_for_file → parse_functions → parse_functions_ts → _collect_functions → _js_returns_void |
| REQ-DDB-GUARD-026 | measured | test_later_method_still_found → _undocumented → validate_file → check_bus_tags |
| REQ-DDB-GUARD-027 | inferred | test_later_method_still_found → _undocumented → validate_file → check_req_exists → _uncheckable |
| REQ-DDB-PIPE-011 | measured | test_later_method_still_found → _undocumented → validate_file → gate_exclusion → binary_file |
| REQ-DDB-WIKI-054 | inferred | test_later_method_still_found → _undocumented → validate_file → gate_exclusion → _gate_matcher → load_toolchain_config → _string_list → all |
Source · 18 lines
def test_later_method_still_found(self, tmp_path):
flagged = self._undocumented(
tmp_path,
"""\
class Thing:
## @brief First.
# @version 1.0
def alpha(self):
pass
## @brief Second.
# @version 1.0
def beta(self):
pass
""",
)
assert flagged == []
Activity · 2 steps
test_multiline_tags
test_guard_python.TestPythonDoxygenBlocks.test_multiline_tags(self)
tests/guard/test_guard_python.py:91
Checks
assert len(functions) == 1assert tags["brief"] == ["Process data from the sensor."]assert tags["version"] == ["2.0"]assert "param" in tagsassert "return" in tags
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-018 | measured | test_multiline_tags → parse_python → parse_lang → parse_functions |
| REQ-DDB-GUARD-019 | measured | test_multiline_tags → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → parse_doxygen_tags |
| REQ-DDB-GUARD-020 | measured | test_multiline_tags → parse_python → parse_lang → parse_functions → parse_functions_ts |
| REQ-DDB-GUARD-021 | inferred | test_multiline_tags → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → _find_python_docstring_block |
| REQ-DDB-GUARD-024 | inferred | test_multiline_tags → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _is_rust_test_item |
| REQ-DDB-GUARD-025 | measured | test_multiline_tags → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _js_returns_void |
Source · 17 lines
def test_multiline_tags(self):
content = dedent("""\
## @brief Process data from the sensor.
# @version 2.0
# @param data Raw sensor reading.
# @return Calibrated value.
def process_sensor(data):
return calibrate(data)
""")
functions = parse_python(content)
assert len(functions) == 1
tags = functions[0].doxygen.tags
assert tags["brief"] == ["Process data from the sensor."]
assert tags["version"] == ["2.0"]
assert "param" in tags
assert "return" in tags
Activity · 8 steps
test_nested_class_first_method
test_guard_python.TestFirstMemberDoxygen.test_nested_class_first_method(self, tmp_path)
tests/guard/test_guard_python.py:414
Checks
assert flagged == []
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-CONFIG-001 | inferred | test_nested_class_first_method → _undocumented → validate_file → get_file_at_revision → run_git → git_argv |
| REQ-DDB-CONFIG-009 | measured | test_nested_class_first_method → _undocumented → validate_file → gate_exclusion |
| REQ-DDB-GUARD-001 | measured | test_nested_class_first_method → _undocumented → validate_file |
| REQ-DDB-GUARD-002 | inferred | test_nested_class_first_method → _undocumented → validate_file → check_version_staleness |
| REQ-DDB-GUARD-003 | measured | test_nested_class_first_method → _undocumented → validate_file → check_tags |
| REQ-DDB-GUARD-004 | measured | test_nested_class_first_method → _undocumented → validate_file → check_req_coverage |
| REQ-DDB-GUARD-005 | measured | test_nested_class_first_method → _undocumented → validate_file → check_return_presence |
| REQ-DDB-GUARD-006 | measured | test_nested_class_first_method → _undocumented → validate_file → check_file_presence |
| REQ-DDB-GUARD-007 | measured | test_nested_class_first_method → _undocumented → validate_file → check_duplicate_tags |
| REQ-DDB-GUARD-009 | inferred | test_nested_class_first_method → _undocumented → validate_file → check_req_coverage → _has_active_requirements → filter_requirements_by_version |
| REQ-DDB-GUARD-011 | inferred | test_nested_class_first_method → _undocumented → validate_file → check_req_coverage → _has_active_requirements → load_requirements_full |
| REQ-DDB-GUARD-013 | measured | test_nested_class_first_method → _undocumented → validate_file → unconfigured_language |
| REQ-DDB-GUARD-014 | inferred | test_nested_class_first_method → _undocumented → validate_file → check_req_coverage → _has_active_requirements → filter_requirements_by_version → parse_version |
| REQ-DDB-GUARD-016 | inferred | test_nested_class_first_method → _undocumented → validate_file → check_req_coverage → _has_active_requirements → filter_requirements_by_version → _summarise_id |
| REQ-DDB-GUARD-018 | measured | test_nested_class_first_method → _undocumented → validate_file → parse_source_file |
| REQ-DDB-GUARD-019 | measured | test_nested_class_first_method → _undocumented → validate_file → check_file_presence → _check_file_block_tags → parse_doxygen_tags |
| REQ-DDB-GUARD-020 | measured | test_nested_class_first_method → _undocumented → validate_file → parse_content_for_file → language_for_file |
| REQ-DDB-GUARD-021 | inferred | test_nested_class_first_method → _undocumented → validate_file → parse_content_for_file → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → _find_python_docstring_block |
| REQ-DDB-GUARD-023 | inferred | test_nested_class_first_method → _undocumented → validate_file → get_file_at_revision |
| REQ-DDB-GUARD-024 | inferred | test_nested_class_first_method → _undocumented → validate_file → check_file_presence → _check_file_block_tags → apply_autobrief |
| REQ-DDB-GUARD-025 | measured | test_nested_class_first_method → _undocumented → validate_file → parse_content_for_file → parse_functions → parse_functions_ts → _collect_functions → _js_returns_void |
| REQ-DDB-GUARD-026 | measured | test_nested_class_first_method → _undocumented → validate_file → check_bus_tags |
| REQ-DDB-GUARD-027 | inferred | test_nested_class_first_method → _undocumented → validate_file → check_req_exists → _uncheckable |
| REQ-DDB-PIPE-011 | measured | test_nested_class_first_method → _undocumented → validate_file → gate_exclusion → binary_file |
| REQ-DDB-WIKI-054 | inferred | test_nested_class_first_method → _undocumented → validate_file → gate_exclusion → _gate_matcher → load_toolchain_config → _string_list → all |
Source · 14 lines
def test_nested_class_first_method(self, tmp_path):
flagged = self._undocumented(
tmp_path,
"""\
class Outer:
class Inner:
## @brief Innermost first method.
# @version 1.0
def deep(self):
pass
""",
)
assert flagged == []
Activity · 2 steps
test_presence_message_c_style_for_c_file
test_guard_python.TestPythonPresenceCheck.test_presence_message_c_style_for_c_file(self, tmp_path)
tests/guard/test_guard_python.py:215
Checks
assert presenceassert "/**" in presence[0].messageassert "##" not in presence[0].message
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-CONFIG-001 | inferred | test_presence_message_c_style_for_c_file → validate_file → get_file_at_revision → run_git → git_argv |
| REQ-DDB-CONFIG-009 | measured | test_presence_message_c_style_for_c_file → validate_file → gate_exclusion |
| REQ-DDB-GUARD-001 | measured | test_presence_message_c_style_for_c_file → validate_file |
| REQ-DDB-GUARD-002 | inferred | test_presence_message_c_style_for_c_file → validate_file → check_version_staleness |
| REQ-DDB-GUARD-003 | measured | test_presence_message_c_style_for_c_file → validate_file → check_tags |
| REQ-DDB-GUARD-004 | measured | test_presence_message_c_style_for_c_file → validate_file → check_req_coverage |
| REQ-DDB-GUARD-005 | measured | test_presence_message_c_style_for_c_file → validate_file → check_return_presence |
| REQ-DDB-GUARD-006 | measured | test_presence_message_c_style_for_c_file → validate_file → check_file_presence |
| REQ-DDB-GUARD-007 | measured | test_presence_message_c_style_for_c_file → validate_file → check_duplicate_tags |
| REQ-DDB-GUARD-009 | inferred | test_presence_message_c_style_for_c_file → validate_file → check_req_coverage → _has_active_requirements → filter_requirements_by_version |
| REQ-DDB-GUARD-011 | inferred | test_presence_message_c_style_for_c_file → validate_file → check_req_coverage → _has_active_requirements → load_requirements_full |
| REQ-DDB-GUARD-013 | measured | test_presence_message_c_style_for_c_file → validate_file → unconfigured_language |
| REQ-DDB-GUARD-014 | inferred | test_presence_message_c_style_for_c_file → validate_file → check_req_coverage → _has_active_requirements → filter_requirements_by_version → parse_version |
| REQ-DDB-GUARD-016 | inferred | test_presence_message_c_style_for_c_file → validate_file → check_req_coverage → _has_active_requirements → filter_requirements_by_version → _summarise_id |
| REQ-DDB-GUARD-018 | measured | test_presence_message_c_style_for_c_file → validate_file → parse_source_file |
| REQ-DDB-GUARD-019 | measured | test_presence_message_c_style_for_c_file → validate_file → check_file_presence → _check_file_block_tags → parse_doxygen_tags |
| REQ-DDB-GUARD-020 | measured | test_presence_message_c_style_for_c_file → validate_file → parse_content_for_file → language_for_file |
| REQ-DDB-GUARD-021 | inferred | test_presence_message_c_style_for_c_file → validate_file → parse_content_for_file → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → _find_python_docstring_block |
| REQ-DDB-GUARD-023 | inferred | test_presence_message_c_style_for_c_file → validate_file → get_file_at_revision |
| REQ-DDB-GUARD-024 | inferred | test_presence_message_c_style_for_c_file → validate_file → check_file_presence → _check_file_block_tags → apply_autobrief |
| REQ-DDB-GUARD-025 | measured | test_presence_message_c_style_for_c_file → validate_file → parse_content_for_file → parse_functions → parse_functions_ts → _collect_functions → _js_returns_void |
| REQ-DDB-GUARD-026 | measured | test_presence_message_c_style_for_c_file → validate_file → check_bus_tags |
| REQ-DDB-GUARD-027 | inferred | test_presence_message_c_style_for_c_file → validate_file → check_req_exists → _uncheckable |
| REQ-DDB-PIPE-011 | measured | test_presence_message_c_style_for_c_file → validate_file → gate_exclusion → binary_file |
| REQ-DDB-WIKI-054 | inferred | test_presence_message_c_style_for_c_file → validate_file → gate_exclusion → _gate_matcher → load_toolchain_config → _string_list → all |
Source · 10 lines
def test_presence_message_c_style_for_c_file(self, tmp_path):
c_file = tmp_path / "bad.c"
c_file.write_text("int undoc(void) { return 0; }\n")
violations = validate_file(str(c_file), CONFIG_DEFAULTS, no_git=True)
presence = [v for v in violations if "no doxygen" in v.message]
assert presence
assert "/**" in presence[0].message
assert "##" not in presence[0].message
Activity · 7 steps
test_presence_message_includes_return_for_non_void
test_guard_python.TestPythonPresenceCheck.test_presence_message_includes_return_for_non_void(self, tmp_path)
tests/guard/test_guard_python.py:189
Checks
assert presenceassert "@return" in presence[0].message
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-CONFIG-001 | inferred | test_presence_message_includes_return_for_non_void → validate_file → get_file_at_revision → run_git → git_argv |
| REQ-DDB-CONFIG-009 | measured | test_presence_message_includes_return_for_non_void → validate_file → gate_exclusion |
| REQ-DDB-GUARD-001 | measured | test_presence_message_includes_return_for_non_void → validate_file |
| REQ-DDB-GUARD-002 | inferred | test_presence_message_includes_return_for_non_void → validate_file → check_version_staleness |
| REQ-DDB-GUARD-003 | measured | test_presence_message_includes_return_for_non_void → validate_file → check_tags |
| REQ-DDB-GUARD-004 | measured | test_presence_message_includes_return_for_non_void → validate_file → check_req_coverage |
| REQ-DDB-GUARD-005 | measured | test_presence_message_includes_return_for_non_void → validate_file → check_return_presence |
| REQ-DDB-GUARD-006 | measured | test_presence_message_includes_return_for_non_void → validate_file → check_file_presence |
| REQ-DDB-GUARD-007 | measured | test_presence_message_includes_return_for_non_void → validate_file → check_duplicate_tags |
| REQ-DDB-GUARD-009 | inferred | test_presence_message_includes_return_for_non_void → validate_file → check_req_coverage → _has_active_requirements → filter_requirements_by_version |
| REQ-DDB-GUARD-011 | inferred | test_presence_message_includes_return_for_non_void → validate_file → check_req_coverage → _has_active_requirements → load_requirements_full |
| REQ-DDB-GUARD-013 | measured | test_presence_message_includes_return_for_non_void → validate_file → unconfigured_language |
| REQ-DDB-GUARD-014 | inferred | test_presence_message_includes_return_for_non_void → validate_file → check_req_coverage → _has_active_requirements → filter_requirements_by_version → parse_version |
| REQ-DDB-GUARD-016 | inferred | test_presence_message_includes_return_for_non_void → validate_file → check_req_coverage → _has_active_requirements → filter_requirements_by_version → _summarise_id |
| REQ-DDB-GUARD-018 | measured | test_presence_message_includes_return_for_non_void → validate_file → parse_source_file |
| REQ-DDB-GUARD-019 | measured | test_presence_message_includes_return_for_non_void → validate_file → check_file_presence → _check_file_block_tags → parse_doxygen_tags |
| REQ-DDB-GUARD-020 | measured | test_presence_message_includes_return_for_non_void → validate_file → parse_content_for_file → language_for_file |
| REQ-DDB-GUARD-021 | measured | test_presence_message_includes_return_for_non_void → validate_file → parse_content_for_file → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → _find_python_docstring_block |
| REQ-DDB-GUARD-023 | inferred | test_presence_message_includes_return_for_non_void → validate_file → get_file_at_revision |
| REQ-DDB-GUARD-024 | inferred | test_presence_message_includes_return_for_non_void → validate_file → check_file_presence → _check_file_block_tags → apply_autobrief |
| REQ-DDB-GUARD-025 | measured | test_presence_message_includes_return_for_non_void → validate_file → parse_content_for_file → parse_functions → parse_functions_ts → _collect_functions → _js_returns_void |
| REQ-DDB-GUARD-026 | measured | test_presence_message_includes_return_for_non_void → validate_file → check_bus_tags |
| REQ-DDB-GUARD-027 | inferred | test_presence_message_includes_return_for_non_void → validate_file → check_req_exists → _uncheckable |
| REQ-DDB-PIPE-011 | measured | test_presence_message_includes_return_for_non_void → validate_file → gate_exclusion → binary_file |
| REQ-DDB-WIKI-054 | inferred | test_presence_message_includes_return_for_non_void → validate_file → gate_exclusion → _gate_matcher → load_toolchain_config → _string_list → all |
Source · 13 lines
def test_presence_message_includes_return_for_non_void(self, tmp_path):
py_file = tmp_path / "bad.py"
py_file.write_text(
dedent("""\
def compute(x: int) -> int:
return x + 1
""")
)
violations = validate_file(str(py_file), CONFIG_DEFAULTS, no_git=True)
presence = [v for v in violations if "no doxygen" in v.message]
assert presence
assert "@return" in presence[0].message
Activity · 6 steps
test_presence_message_omits_return_for_void
test_guard_python.TestPythonPresenceCheck.test_presence_message_omits_return_for_void(self, tmp_path)
tests/guard/test_guard_python.py:202
Checks
assert presenceassert "@return" not in presence[0].message
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-CONFIG-001 | inferred | test_presence_message_omits_return_for_void → validate_file → get_file_at_revision → run_git → git_argv |
| REQ-DDB-CONFIG-009 | measured | test_presence_message_omits_return_for_void → validate_file → gate_exclusion |
| REQ-DDB-GUARD-001 | measured | test_presence_message_omits_return_for_void → validate_file |
| REQ-DDB-GUARD-002 | inferred | test_presence_message_omits_return_for_void → validate_file → check_version_staleness |
| REQ-DDB-GUARD-003 | measured | test_presence_message_omits_return_for_void → validate_file → check_tags |
| REQ-DDB-GUARD-004 | measured | test_presence_message_omits_return_for_void → validate_file → check_req_coverage |
| REQ-DDB-GUARD-005 | measured | test_presence_message_omits_return_for_void → validate_file → check_return_presence |
| REQ-DDB-GUARD-006 | measured | test_presence_message_omits_return_for_void → validate_file → check_file_presence |
| REQ-DDB-GUARD-007 | measured | test_presence_message_omits_return_for_void → validate_file → check_duplicate_tags |
| REQ-DDB-GUARD-009 | inferred | test_presence_message_omits_return_for_void → validate_file → check_req_coverage → _has_active_requirements → filter_requirements_by_version |
| REQ-DDB-GUARD-011 | inferred | test_presence_message_omits_return_for_void → validate_file → check_req_coverage → _has_active_requirements → load_requirements_full |
| REQ-DDB-GUARD-013 | measured | test_presence_message_omits_return_for_void → validate_file → unconfigured_language |
| REQ-DDB-GUARD-014 | inferred | test_presence_message_omits_return_for_void → validate_file → check_req_coverage → _has_active_requirements → filter_requirements_by_version → parse_version |
| REQ-DDB-GUARD-016 | inferred | test_presence_message_omits_return_for_void → validate_file → check_req_coverage → _has_active_requirements → filter_requirements_by_version → _summarise_id |
| REQ-DDB-GUARD-018 | measured | test_presence_message_omits_return_for_void → validate_file → parse_source_file |
| REQ-DDB-GUARD-019 | measured | test_presence_message_omits_return_for_void → validate_file → check_file_presence → _check_file_block_tags → parse_doxygen_tags |
| REQ-DDB-GUARD-020 | measured | test_presence_message_omits_return_for_void → validate_file → parse_content_for_file → language_for_file |
| REQ-DDB-GUARD-021 | measured | test_presence_message_omits_return_for_void → validate_file → parse_content_for_file → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → _find_python_docstring_block |
| REQ-DDB-GUARD-023 | inferred | test_presence_message_omits_return_for_void → validate_file → get_file_at_revision |
| REQ-DDB-GUARD-024 | inferred | test_presence_message_omits_return_for_void → validate_file → check_file_presence → _check_file_block_tags → apply_autobrief |
| REQ-DDB-GUARD-025 | measured | test_presence_message_omits_return_for_void → validate_file → parse_content_for_file → parse_functions → parse_functions_ts → _collect_functions → _js_returns_void |
| REQ-DDB-GUARD-026 | measured | test_presence_message_omits_return_for_void → validate_file → check_bus_tags |
| REQ-DDB-GUARD-027 | inferred | test_presence_message_omits_return_for_void → validate_file → check_req_exists → _uncheckable |
| REQ-DDB-PIPE-011 | measured | test_presence_message_omits_return_for_void → validate_file → gate_exclusion → binary_file |
| REQ-DDB-WIKI-054 | inferred | test_presence_message_omits_return_for_void → validate_file → gate_exclusion → _gate_matcher → load_toolchain_config → _string_list → all |
Source · 13 lines
def test_presence_message_omits_return_for_void(self, tmp_path):
py_file = tmp_path / "bad.py"
py_file.write_text(
dedent("""\
def emit(x: int) -> None:
print(x)
""")
)
violations = validate_file(str(py_file), CONFIG_DEFAULTS, no_git=True)
presence = [v for v in violations if "no doxygen" in v.message]
assert presence
assert "@return" not in presence[0].message
Activity · 6 steps
test_presence_message_python_style
test_guard_python.TestPythonPresenceCheck.test_presence_message_python_style(self, tmp_path)
tests/guard/test_guard_python.py:173
Checks
assert presence, "expected a presence violation"assert "/**" not in msg, "C-style skeleton must not leak into Python suggestion"assert "##" in msgassert "@brief" in msg and "@version" in msg
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-CONFIG-001 | inferred | test_presence_message_python_style → validate_file → get_file_at_revision → run_git → git_argv |
| REQ-DDB-CONFIG-009 | measured | test_presence_message_python_style → validate_file → gate_exclusion |
| REQ-DDB-GUARD-001 | measured | test_presence_message_python_style → validate_file |
| REQ-DDB-GUARD-002 | inferred | test_presence_message_python_style → validate_file → check_version_staleness |
| REQ-DDB-GUARD-003 | measured | test_presence_message_python_style → validate_file → check_tags |
| REQ-DDB-GUARD-004 | measured | test_presence_message_python_style → validate_file → check_req_coverage |
| REQ-DDB-GUARD-005 | measured | test_presence_message_python_style → validate_file → check_return_presence |
| REQ-DDB-GUARD-006 | measured | test_presence_message_python_style → validate_file → check_file_presence |
| REQ-DDB-GUARD-007 | measured | test_presence_message_python_style → validate_file → check_duplicate_tags |
| REQ-DDB-GUARD-009 | inferred | test_presence_message_python_style → validate_file → check_req_coverage → _has_active_requirements → filter_requirements_by_version |
| REQ-DDB-GUARD-011 | inferred | test_presence_message_python_style → validate_file → check_req_coverage → _has_active_requirements → load_requirements_full |
| REQ-DDB-GUARD-013 | measured | test_presence_message_python_style → validate_file → unconfigured_language |
| REQ-DDB-GUARD-014 | inferred | test_presence_message_python_style → validate_file → check_req_coverage → _has_active_requirements → filter_requirements_by_version → parse_version |
| REQ-DDB-GUARD-016 | inferred | test_presence_message_python_style → validate_file → check_req_coverage → _has_active_requirements → filter_requirements_by_version → _summarise_id |
| REQ-DDB-GUARD-018 | measured | test_presence_message_python_style → validate_file → parse_source_file |
| REQ-DDB-GUARD-019 | measured | test_presence_message_python_style → validate_file → check_file_presence → _check_file_block_tags → parse_doxygen_tags |
| REQ-DDB-GUARD-020 | measured | test_presence_message_python_style → validate_file → parse_content_for_file → language_for_file |
| REQ-DDB-GUARD-021 | measured | test_presence_message_python_style → validate_file → parse_content_for_file → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → _find_python_docstring_block |
| REQ-DDB-GUARD-023 | inferred | test_presence_message_python_style → validate_file → get_file_at_revision |
| REQ-DDB-GUARD-024 | inferred | test_presence_message_python_style → validate_file → check_file_presence → _check_file_block_tags → apply_autobrief |
| REQ-DDB-GUARD-025 | measured | test_presence_message_python_style → validate_file → parse_content_for_file → parse_functions → parse_functions_ts → _collect_functions → _js_returns_void |
| REQ-DDB-GUARD-026 | measured | test_presence_message_python_style → validate_file → check_bus_tags |
| REQ-DDB-GUARD-027 | inferred | test_presence_message_python_style → validate_file → check_req_exists → _uncheckable |
| REQ-DDB-PIPE-011 | measured | test_presence_message_python_style → validate_file → gate_exclusion → binary_file |
| REQ-DDB-WIKI-054 | inferred | test_presence_message_python_style → validate_file → gate_exclusion → _gate_matcher → load_toolchain_config → _string_list → all |
Source · 16 lines
def test_presence_message_python_style(self, tmp_path):
py_file = tmp_path / "bad.py"
py_file.write_text(
dedent("""\
def undoc() -> None:
pass
""")
)
violations = validate_file(str(py_file), CONFIG_DEFAULTS, no_git=True)
presence = [v for v in violations if v.check == "presence" and "no doxygen" in v.message]
assert presence, "expected a presence violation"
msg = presence[0].message
assert "/**" not in msg, "C-style skeleton must not leak into Python suggestion"
assert "##" in msg
assert "@brief" in msg and "@version" in msg
Activity · 9 steps
test_prose_docstring_is_the_block_and_its_summary_the_brief
test_guard_python.TestPythonDocstringTags.test_prose_docstring_is_the_block_and_its_summary_the_brief(self)
PEP 257 leads (changed from upstream, which ignored an untagged docstring): the docstring documents the function, so only the missing revision tag is reported.
tests/guard/test_guard_python.py:264
Checks
assert len(functions) == 1assert functions[0].doxygen is not Noneassert functions[0].doxygen.tags["brief"] == ["Just a prose docstring."]assert "version" not in functions[0].doxygen.tags
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-018 | measured | test_prose_docstring_is_the_block_and_its_summary_the_brief → parse_python → parse_lang → parse_functions |
| REQ-DDB-GUARD-019 | measured | test_prose_docstring_is_the_block_and_its_summary_the_brief → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → parse_doxygen_tags |
| REQ-DDB-GUARD-020 | measured | test_prose_docstring_is_the_block_and_its_summary_the_brief → parse_python → parse_lang → parse_functions → parse_functions_ts |
| REQ-DDB-GUARD-021 | measured | test_prose_docstring_is_the_block_and_its_summary_the_brief → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → _find_python_docstring_block |
| REQ-DDB-GUARD-024 | measured | test_prose_docstring_is_the_block_and_its_summary_the_brief → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _is_rust_test_item |
| REQ-DDB-GUARD-025 | measured | test_prose_docstring_is_the_block_and_its_summary_the_brief → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _js_returns_void |
Source · 17 lines
def test_prose_docstring_is_the_block_and_its_summary_the_brief(self):
"""PEP 257 leads (changed from upstream, which ignored an untagged docstring): the
docstring documents the function, so only the missing revision tag is reported."""
content = dedent('''\
def helper():
"""Just a prose docstring.
More detail that is not the summary.
"""
return 1
''')
functions = parse_python(content)
assert len(functions) == 1
assert functions[0].doxygen is not None
assert functions[0].doxygen.tags["brief"] == ["Just a prose docstring."]
assert "version" not in functions[0].doxygen.tags
Activity · 6 steps
test_regular_comment_not_doxygen
test_guard_python.TestPythonDoxygenBlocks.test_regular_comment_not_doxygen(self)
tests/guard/test_guard_python.py:71
Checks
assert len(functions) == 1assert functions[0].doxygen is None
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-018 | measured | test_regular_comment_not_doxygen → parse_python → parse_lang → parse_functions |
| REQ-DDB-GUARD-019 | measured | test_regular_comment_not_doxygen → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → parse_doxygen_tags |
| REQ-DDB-GUARD-020 | measured | test_regular_comment_not_doxygen → parse_python → parse_lang → parse_functions → parse_functions_ts |
| REQ-DDB-GUARD-021 | measured | test_regular_comment_not_doxygen → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → _find_python_docstring_block |
| REQ-DDB-GUARD-024 | inferred | test_regular_comment_not_doxygen → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _is_rust_test_item |
| REQ-DDB-GUARD-025 | measured | test_regular_comment_not_doxygen → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _js_returns_void |
Source · 10 lines
def test_regular_comment_not_doxygen(self):
content = dedent("""\
# just a regular comment
def func():
pass
""")
functions = parse_python(content)
assert len(functions) == 1
assert functions[0].doxygen is None
Activity · 4 steps
test_single_line_docstring_with_tags
test_guard_python.TestPythonDocstringTags.test_single_line_docstring_with_tags(self)
tests/guard/test_guard_python.py:308
Checks
assert len(functions) == 1assert dox is not Noneassert dox.tags["brief"] == ["One-liner."]assert dox.tags["version"] == ["1.0"]
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-018 | measured | test_single_line_docstring_with_tags → parse_python → parse_lang → parse_functions |
| REQ-DDB-GUARD-019 | measured | test_single_line_docstring_with_tags → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → parse_doxygen_tags |
| REQ-DDB-GUARD-020 | measured | test_single_line_docstring_with_tags → parse_python → parse_lang → parse_functions → parse_functions_ts |
| REQ-DDB-GUARD-021 | measured | test_single_line_docstring_with_tags → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → _find_python_docstring_block |
| REQ-DDB-GUARD-024 | measured | test_single_line_docstring_with_tags → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _is_rust_test_item |
| REQ-DDB-GUARD-025 | measured | test_single_line_docstring_with_tags → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _js_returns_void |
Source · 13 lines
def test_single_line_docstring_with_tags(self):
content = dedent('''\
def helper():
"""@brief One-liner. @version 1.0"""
pass
''')
functions = parse_python(content)
assert len(functions) == 1
dox = functions[0].doxygen
assert dox is not None
assert dox.tags["brief"] == ["One-liner."]
assert dox.tags["version"] == ["1.0"]
Activity · 7 steps
test_single_line_doxygen
test_guard_python.TestPythonDoxygenBlocks.test_single_line_doxygen(self)
tests/guard/test_guard_python.py:108
Checks
assert len(functions) == 1assert functions[0].doxygen is not Noneassert "brief" in functions[0].doxygen.tagsassert "version" in functions[0].doxygen.tags
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-018 | measured | test_single_line_doxygen → parse_python → parse_lang → parse_functions |
| REQ-DDB-GUARD-019 | measured | test_single_line_doxygen → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → parse_doxygen_tags |
| REQ-DDB-GUARD-020 | measured | test_single_line_doxygen → parse_python → parse_lang → parse_functions → parse_functions_ts |
| REQ-DDB-GUARD-021 | inferred | test_single_line_doxygen → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → _find_python_docstring_block |
| REQ-DDB-GUARD-024 | inferred | test_single_line_doxygen → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _is_rust_test_item |
| REQ-DDB-GUARD-025 | measured | test_single_line_doxygen → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _js_returns_void |
Source · 12 lines
def test_single_line_doxygen(self):
content = dedent("""\
## @brief Quick helper. @version 1.0
def helper():
pass
""")
functions = parse_python(content)
assert len(functions) == 1
assert functions[0].doxygen is not None
assert "brief" in functions[0].doxygen.tags
assert "version" in functions[0].doxygen.tags
Activity · 6 steps
test_three_tags_single_line
test_guard_python.TestPythonDoxygenBlocks.test_three_tags_single_line(self)
tests/guard/test_guard_python.py:120
Checks
assert len(functions) == 1assert tags["brief"] == ["Helper."]assert tags["version"] == ["1.0"]assert tags["req"] == ["REQ-001"]
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-018 | measured | test_three_tags_single_line → parse_python → parse_lang → parse_functions |
| REQ-DDB-GUARD-019 | measured | test_three_tags_single_line → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → parse_doxygen_tags |
| REQ-DDB-GUARD-020 | measured | test_three_tags_single_line → parse_python → parse_lang → parse_functions → parse_functions_ts |
| REQ-DDB-GUARD-021 | inferred | test_three_tags_single_line → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → _find_python_docstring_block |
| REQ-DDB-GUARD-024 | inferred | test_three_tags_single_line → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _is_rust_test_item |
| REQ-DDB-GUARD-025 | measured | test_three_tags_single_line → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _js_returns_void |
Source · 13 lines
def test_three_tags_single_line(self):
content = dedent("""\
## @brief Helper. @version 1.0 @req REQ-001
def helper():
pass
""")
functions = parse_python(content)
assert len(functions) == 1
tags = functions[0].doxygen.tags
assert tags["brief"] == ["Helper."]
assert tags["version"] == ["1.0"]
assert tags["req"] == ["REQ-001"]
Activity · 7 steps
test_triple_hash_not_doxygen
test_guard_python.TestPythonDoxygenBlocks.test_triple_hash_not_doxygen(self)
tests/guard/test_guard_python.py:81
Checks
assert len(functions) == 1assert functions[0].doxygen is None
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-018 | measured | test_triple_hash_not_doxygen → parse_python → parse_lang → parse_functions |
| REQ-DDB-GUARD-019 | measured | test_triple_hash_not_doxygen → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → parse_doxygen_tags |
| REQ-DDB-GUARD-020 | measured | test_triple_hash_not_doxygen → parse_python → parse_lang → parse_functions → parse_functions_ts |
| REQ-DDB-GUARD-021 | measured | test_triple_hash_not_doxygen → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → _find_python_docstring_block |
| REQ-DDB-GUARD-024 | inferred | test_triple_hash_not_doxygen → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _is_rust_test_item |
| REQ-DDB-GUARD-025 | measured | test_triple_hash_not_doxygen → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _js_returns_void |
Source · 10 lines
def test_triple_hash_not_doxygen(self):
content = dedent("""\
### Section header ###
def func():
pass
""")
functions = parse_python(content)
assert len(functions) == 1
assert functions[0].doxygen is None
Activity · 4 steps
test_undocumented_detected
test_guard_python.TestPythonDoxygenBlocks.test_undocumented_detected(self)
tests/guard/test_guard_python.py:64
Checks
assert by_name["undocumented_function"].doxygen is Noneassert by_name["undocumented_method"].doxygen is None
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-018 | measured | test_undocumented_detected → parse_python → parse_lang → parse_functions |
| REQ-DDB-GUARD-019 | measured | test_undocumented_detected → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → parse_doxygen_tags |
| REQ-DDB-GUARD-020 | measured | test_undocumented_detected → parse_python → parse_lang → parse_functions → parse_functions_ts |
| REQ-DDB-GUARD-021 | measured | test_undocumented_detected → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → _find_python_docstring_block |
| REQ-DDB-GUARD-024 | inferred | test_undocumented_detected → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _is_rust_test_item |
| REQ-DDB-GUARD-025 | measured | test_undocumented_detected → parse_python → parse_lang → parse_functions → parse_functions_ts → _collect_functions → _js_returns_void |
Source · 7 lines
def test_undocumented_detected(self):
content = (FIXTURES_DIR / "python_simple.py").read_text()
functions = parse_python(content)
by_name = {f.name: f for f in functions}
assert by_name["undocumented_function"].doxygen is None
assert by_name["undocumented_method"].doxygen is None
Activity · 5 steps
test_validate_file_python
test_guard_python.TestPythonPresenceCheck.test_validate_file_python(self)
tests/guard/test_guard_python.py:149
Checks
assert any("undocumented_function" in m for m in names_flagged)assert any("undocumented_method" in m for m in names_flagged)
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-CONFIG-001 | inferred | test_validate_file_python → validate_file → get_file_at_revision → run_git → git_argv |
| REQ-DDB-CONFIG-009 | measured | test_validate_file_python → validate_file → gate_exclusion |
| REQ-DDB-GUARD-001 | measured | test_validate_file_python → validate_file |
| REQ-DDB-GUARD-002 | inferred | test_validate_file_python → validate_file → check_version_staleness |
| REQ-DDB-GUARD-003 | measured | test_validate_file_python → validate_file → check_tags |
| REQ-DDB-GUARD-004 | measured | test_validate_file_python → validate_file → check_req_coverage |
| REQ-DDB-GUARD-005 | measured | test_validate_file_python → validate_file → check_return_presence |
| REQ-DDB-GUARD-006 | measured | test_validate_file_python → validate_file → check_file_presence |
| REQ-DDB-GUARD-007 | measured | test_validate_file_python → validate_file → check_duplicate_tags |
| REQ-DDB-GUARD-009 | inferred | test_validate_file_python → validate_file → check_req_coverage → _has_active_requirements → filter_requirements_by_version |
| REQ-DDB-GUARD-011 | inferred | test_validate_file_python → validate_file → check_req_coverage → _has_active_requirements → load_requirements_full |
| REQ-DDB-GUARD-013 | measured | test_validate_file_python → validate_file → unconfigured_language |
| REQ-DDB-GUARD-014 | inferred | test_validate_file_python → validate_file → check_req_coverage → _has_active_requirements → filter_requirements_by_version → parse_version |
| REQ-DDB-GUARD-016 | inferred | test_validate_file_python → validate_file → check_req_coverage → _has_active_requirements → filter_requirements_by_version → _summarise_id |
| REQ-DDB-GUARD-018 | measured | test_validate_file_python → validate_file → parse_source_file |
| REQ-DDB-GUARD-019 | measured | test_validate_file_python → validate_file → check_file_presence → _check_file_block_tags → parse_doxygen_tags |
| REQ-DDB-GUARD-020 | measured | test_validate_file_python → validate_file → parse_content_for_file → language_for_file |
| REQ-DDB-GUARD-021 | measured | test_validate_file_python → validate_file → parse_content_for_file → parse_functions → parse_functions_ts → _collect_functions → _find_preceding_doxygen → _find_python_docstring_block |
| REQ-DDB-GUARD-023 | inferred | test_validate_file_python → validate_file → get_file_at_revision |
| REQ-DDB-GUARD-024 | inferred | test_validate_file_python → validate_file → check_file_presence → _check_file_block_tags → apply_autobrief |
| REQ-DDB-GUARD-025 | measured | test_validate_file_python → validate_file → parse_content_for_file → parse_functions → parse_functions_ts → _collect_functions → _js_returns_void |
| REQ-DDB-GUARD-026 | measured | test_validate_file_python → validate_file → check_bus_tags |
| REQ-DDB-GUARD-027 | inferred | test_validate_file_python → validate_file → check_req_exists → _uncheckable |
| REQ-DDB-PIPE-011 | measured | test_validate_file_python → validate_file → gate_exclusion → binary_file |
| REQ-DDB-WIKI-054 | inferred | test_validate_file_python → validate_file → gate_exclusion → _gate_matcher → load_toolchain_config → _string_list → all |
Source · 11 lines
def test_validate_file_python(self):
violations = validate_file(
str(FIXTURES_DIR / "python_simple.py"),
CONFIG_DEFAULTS,
no_git=True,
)
undoc = [v for v in violations if "no doxygen comment" in v.message]
names_flagged = [v.message for v in undoc]
assert any("undocumented_function" in m for m in names_flagged)
assert any("undocumented_method" in m for m in names_flagged)