REQ-DDB-GUARD-021: Python docstrings are documentation (PEP 257 leads)¶
What it requires
- A non-empty function docstring is the function's doc block, with or without tags; its summary line satisfies brief unless brief is written; version and req tags go inside it; a preceding two-hash block takes precedence when both exist; an empty docstring is not a block.
- (Changed from doxygen-guard, which ignored untagged docstrings.)
- tier
- PASS
- declared
- implemented
- priority
- P1
How it is met
Implemented by
_find_python_docstring_blockclew/guard/ts_parser.py:529
Tests (166)
Linked directly
22 tests: 22 passed
22 passed
| test | result | linked by | implementers exercised | calls away |
|---|---|---|---|---|
test_impact_no_files_returns_0 | passed | measured | 1 of 1: _find_python_docstring_block | — |
test_validate_writes_the_format_to_stdout_and_keeps_the_exit_code | passed | measured | 1 of 1: _find_python_docstring_block | — |
test_python_body_end | passed | measured | 1 of 1: _find_python_docstring_block | 4 |
test_python_no_doxygen | passed | measured | 1 of 1: _find_python_docstring_block | 4 |
test_docstring_satisfies_req_tag | passed | measured | 1 of 1: _find_python_docstring_block | 7 |
test_docstring_tags_satisfy_presence | passed | measured | 1 of 1: _find_python_docstring_block | 7 |
test_docstring_tags_via_regex_parser | passed | measured | 1 of 1: _find_python_docstring_block | 7 |
test_doxygen_associated_correctly | passed | measured | 1 of 1: _find_python_docstring_block | 7 |
test_empty_docstring_is_not_a_block | passed | measured | 1 of 1: _find_python_docstring_block | 7 |
test_finds_all_functions | passed | measured | 1 of 1: _find_python_docstring_block | 7 |
test_presence_message_includes_return_for_non_void | passed | measured | 1 of 1: _find_python_docstring_block | 7 |
test_presence_message_omits_return_for_void | passed | measured | 1 of 1: _find_python_docstring_block | 7 |
test_presence_message_python_style | passed | measured | 1 of 1: _find_python_docstring_block | 7 |
test_prose_docstring_is_the_block_and_its_summary_the_brief | passed | measured | 1 of 1: _find_python_docstring_block | 7 |
test_regular_comment_not_doxygen | passed | measured | 1 of 1: _find_python_docstring_block | 7 |
test_single_line_docstring_with_tags | passed | measured | 1 of 1: _find_python_docstring_block | 7 |
test_triple_hash_not_doxygen | passed | measured | 1 of 1: _find_python_docstring_block | 7 |
test_undocumented_detected | passed | measured | 1 of 1: _find_python_docstring_block | 7 |
test_validate_file_python | passed | measured | 1 of 1: _find_python_docstring_block | 7 |
test_class_level_block_does_not_leak_to_first_method | passed | measured | 1 of 1: _find_python_docstring_block | 8 |
test_a_range_with_no_files_reads_the_files_the_range_changed | passed | measured | 1 of 1: _find_python_docstring_block | 12 |
test_full_pipeline | passed | measured | 1 of 1: _find_python_docstring_block | 12 |
Reached through calls
144 tests: 144 passed
144 passed
| test | result | linked by | implementers exercised | calls away |
|---|---|---|---|---|
test_basic_c_function | passed | inferred | 1 of 1: _find_python_docstring_block | 4 |
test_basic_python_function | passed | inferred | 1 of 1: _find_python_docstring_block | 4 |
test_body_end_line | passed | inferred | 1 of 1: _find_python_docstring_block | 4 |
test_cloud_fixture | passed | inferred | 1 of 1: _find_python_docstring_block | 4 |
test_decorated_function | passed | inferred | 1 of 1: _find_python_docstring_block | 4 |
test_doxygen_tags_extracted | passed | inferred | 1 of 1: _find_python_docstring_block | 4 |
test_exclude_names | passed | inferred | 1 of 1: _find_python_docstring_block | 4 |
test_forward_declaration_excluded | passed | inferred | 1 of 1: _find_python_docstring_block | 4 |
test_function_without_doxygen | passed | inferred | 1 of 1: _find_python_docstring_block | 4 |
test_inline_constructor | passed | inferred | 1 of 1: _find_python_docstring_block | 4 |
test_inline_destructor | passed | inferred | 1 of 1: _find_python_docstring_block | 4 |
test_method_not_constructor | passed | inferred | 1 of 1: _find_python_docstring_block | 4 |
test_multiple_functions | passed | inferred | 1 of 1: _find_python_docstring_block | 4 |
test_out_of_line_constructor | passed | inferred | 1 of 1: _find_python_docstring_block | 4 |
test_pairing_fixture | passed | inferred | 1 of 1: _find_python_docstring_block | 4 |
test_standalone_function_no_enclosing | passed | inferred | 1 of 1: _find_python_docstring_block | 4 |
test_static_function | passed | inferred | 1 of 1: _find_python_docstring_block | 4 |
test_struct_constructor | passed | inferred | 1 of 1: _find_python_docstring_block | 4 |
test_the_gate_checks_mixin_members_and_stays_within_the_index | passed | inferred | 1 of 1: _find_python_docstring_block | 4 |
test_wifi_fixture | passed | inferred | 1 of 1: _find_python_docstring_block | 4 |
test_a_blank_line_inside_the_run_ends_the_block | passed | inferred | 1 of 1: _find_python_docstring_block | 6 |
test_block_lines_are_zero_indexed_and_inclusive | passed | inferred | 1 of 1: _find_python_docstring_block | 6 |
test_cfg_test_module_is_not_gated | passed | inferred | 1 of 1: _find_python_docstring_block | 6 |
test_doc_reaches_across_attributes | passed | inferred | 1 of 1: _find_python_docstring_block | 6 |
test_explicit_brief_wins_over_summary | passed | inferred | 1 of 1: _find_python_docstring_block | 6 |
test_fixture_functions_and_blocks | passed | inferred | 1 of 1: _find_python_docstring_block | 6 |
test_functions_found_and_named | passed | inferred | 1 of 1: _find_python_docstring_block | 6 |
test_generic_impl_names_its_self_type | passed | inferred | 1 of 1: _find_python_docstring_block | 6 |
test_jsdoc_is_found_above_export_and_const | passed | inferred | 1 of 1: _find_python_docstring_block | 6 |
test_non_outer_doc_comments_are_not_blocks | passed | inferred | 1 of 1: _find_python_docstring_block | 6 |
test_plain_comment_is_not_jsdoc | passed | inferred | 1 of 1: _find_python_docstring_block | 6 |
test_return_annotation_decides_void | passed | inferred | 1 of 1: _find_python_docstring_block | 6 |
test_return_is_not_required_for_rust | passed | inferred | 1 of 1: _find_python_docstring_block | 6 |
test_staleness_detects_an_unbumped_rust_body | passed | inferred | 1 of 1: _find_python_docstring_block | 6 |
test_summary_is_the_brief | passed | inferred | 1 of 1: _find_python_docstring_block | 6 |
test_summary_paragraph_is_the_brief | passed | inferred | 1 of 1: _find_python_docstring_block | 6 |
test_test_functions_are_not_gated | passed | inferred | 1 of 1: _find_python_docstring_block | 6 |
test_tsx_parses_jsx | passed | inferred | 1 of 1: _find_python_docstring_block | 6 |
test_a_broken_toolchain_file_is_reported_not_fatal | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_all_checks_run | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_arbitrary_tags_are_parsed | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_async_def_detected | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_attribute_inline | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_attribute_unused | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_attribute_visibility_hidden | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_bad_tags_all_fail | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_binary_named_as_source_is_skipped | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_block_above_takes_precedence_over_docstring | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_body_end_tracking | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_braces_in_strings_body_end | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_class_level_block_does_not_leak_to_first_member | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_class_qualified_method | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_clew_specific_ignores_apply_to_the_gate | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_cpp_fixture_file | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_custom_tag_single_line | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_decorative_not_treated_as_doxygen | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_decorative_triggers_presence_violation | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_documented_file_no_violations | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_double_star_still_matches | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_excluded_file | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_excluded_path_is_absent_and_gate_skips_it | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_extern_c_linkage | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_file_tag_in_prose_does_not_suppress_the_block | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_first_member_after_access_specifier | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_first_member_with_no_access_specifier | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_first_method_version_is_its_own | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_fixture_violations | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_forward_declarations_are_always_skipped | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_forward_declarations_skipped | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_fully_documented_python | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_good_tags_all_pass | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_inline_typedef_return | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_inner_doc_satisfies_the_file_block_without_at_file | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_javascript_extensions | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_lowercase_typedef_return | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_missing_file_block_suggests_inner_doc | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_modified_overload_flags_only_that_overload | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_multiline_attribute_is_handled_correctly | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_multiline_tags | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_namespaced_return_type | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_nested_lookalike_path_agrees | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_no_false_positives | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_no_false_positives_with_attributes | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_only_definitions_checked | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_opt_in | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_presence_message_c_style_for_c_file | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_require_return_bites_only_on_valued_annotations | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_return_requirement_can_be_turned_back_on | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_rust_is_opt_in | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_simple_c_file | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_single_line_doxygen | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_stale_version_detected | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_static_macro_qualifier | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_struct_qualified_return | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_tags_parsed_correctly | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_three_tags_single_line | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_toolchain_ignore_paths_skip_validation | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_tsx_file_uses_typescript_config | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_typedef_pointer_return | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_unbalanced_string_brace_is_handled_correctly | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_undocumented_definition_after_decl | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_undocumented_typedef_detected | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_unknown_extension_skipped | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_unmodified_overloads_no_violation | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_updated_version_no_violation | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_violations | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_weak_macro_qualifier | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_without_toolchain_files_everything_is_checked | passed | inferred | 1 of 1: _find_python_docstring_block | 7 |
test_a_changed_signature_with_a_bump_is_clean | passed | inferred | 1 of 1: _find_python_docstring_block | 8 |
test_a_changed_signature_without_a_bump_is_stale | passed | inferred | 1 of 1: _find_python_docstring_block | 8 |
test_a_cpp_member_declaration_is_checked_too | passed | inferred | 1 of 1: _find_python_docstring_block | 8 |
test_a_dead_req_on_a_documented_declaration_is_refused | passed | inferred | 1 of 1: _find_python_docstring_block | 8 |
test_a_declaration_does_not_need_its_own_req | passed | inferred | 1 of 1: _find_python_docstring_block | 8 |
test_a_documented_declaration_needs_its_version | passed | inferred | 1 of 1: _find_python_docstring_block | 8 |
test_added_copy_leaves_existing_copies_clean | passed | inferred | 1 of 1: _find_python_docstring_block | 8 |
test_an_overload_set_keeps_the_exact_match | passed | inferred | 1 of 1: _find_python_docstring_block | 8 |
test_an_undocumented_declaration_is_not_a_finding | passed | inferred | 1 of 1: _find_python_docstring_block | 8 |
test_dg_internal_is_refused_naming_its_replacement | passed | inferred | 1 of 1: _find_python_docstring_block | 8 |
test_excludes_are_globs_and_a_regex_says_so | passed | inferred | 1 of 1: _find_python_docstring_block | 8 |
test_first_copy_edited_with_bump_is_clean | passed | inferred | 1 of 1: _find_python_docstring_block | 8 |
test_first_copy_edited_without_bump_differing_versions_is_flagged | passed | inferred | 1 of 1: _find_python_docstring_block | 8 |
test_first_method_after_class_docstring_still_found | passed | inferred | 1 of 1: _find_python_docstring_block | 8 |
test_first_method_directly_after_class_line | passed | inferred | 1 of 1: _find_python_docstring_block | 8 |
test_guard_knows_the_tag_and_refuses_an_undeclared_id | passed | inferred | 1 of 1: _find_python_docstring_block | 8 |
test_guard_refuses_a_marker_naming_an_undeclared_mode | passed | inferred | 1 of 1: _find_python_docstring_block | 8 |
test_later_method_still_found | passed | inferred | 1 of 1: _find_python_docstring_block | 8 |
test_nested_class_first_method | passed | inferred | 1 of 1: _find_python_docstring_block | 8 |
test_removed_copy_leaves_remaining_copy_clean | passed | inferred | 1 of 1: _find_python_docstring_block | 8 |
test_second_copy_edited_without_bump_is_flagged_alone | passed | inferred | 1 of 1: _find_python_docstring_block | 8 |
test_the_refusal_survives_known_tags_warn_off | passed | inferred | 1 of 1: _find_python_docstring_block | 8 |
test_unchanged_separate_ifdef_blocks_are_clean | passed | inferred | 1 of 1: _find_python_docstring_block | 8 |
test_unsupported_extension_returns_none | passed | inferred | 1 of 1: _find_python_docstring_block | 8 |
test_utility_is_accepted | passed | inferred | 1 of 1: _find_python_docstring_block | 8 |
test_a_requirement_implemented_by_a_dependency_at_its_pin_is_covered_via_it | passed | inferred | 1 of 1: _find_python_docstring_block | 10 |
test_a_submodule_in_the_range_is_an_unmapped_file_never_opened | passed | inferred | 1 of 1: _find_python_docstring_block | 10 |
test_an_exempt_status_is_listed_not_counted_as_a_gap | passed | inferred | 1 of 1: _find_python_docstring_block | 10 |
test_analyze_coverage_structure | passed | inferred | 1 of 1: _find_python_docstring_block | 10 |
test_coverage_treats_a_declaration_and_its_definition_as_one | passed | inferred | 1 of 1: _find_python_docstring_block | 10 |
test_covering_tests_are_read_from_the_test_tree | passed | inferred | 1 of 1: _find_python_docstring_block | 10 |
test_off_by_default_nothing_changes | passed | inferred | 1 of 1: _find_python_docstring_block | 10 |
test_without_exempt_status_nothing_is_exempt | passed | inferred | 1 of 1: _find_python_docstring_block | 10 |
test_finds_changed_function | passed | inferred | 1 of 1: _find_python_docstring_block | 11 |
test_no_change_no_result | passed | inferred | 1 of 1: _find_python_docstring_block | 11 |
test_with_every_gap_exempt_the_gate_passes_and_still_names_them | passed | inferred | 1 of 1: _find_python_docstring_block | 11 |