REQ-DDB-GUARD-021: Python docstrings are documentation (PEP 257 leads)

← Requirements

What it requires

  1. 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.
  2. (Changed from doxygen-guard, which ignored untagged docstrings.)
tier
PASS
declared
implemented
priority
P1

Where it lives

  • Guard: the pre-commit gate1

See it on the map

How it is met

implemented byresults (166 tests)_find_python_docstring_block166 passed166 tests, a summary by result: every test is in the tests table below

Show on the map

Implemented by

Tests (166)

Linked directly

22 tests: 22 passed

22 passed
testresultlinked byimplementers exercisedcalls away
test_impact_no_files_returns_0passedmeasured1 of 1: _find_python_docstring_block—
test_validate_writes_the_format_to_stdout_and_keeps_the_exit_codepassedmeasured1 of 1: _find_python_docstring_block—
test_python_body_endpassedmeasured1 of 1: _find_python_docstring_block4
test_python_no_doxygenpassedmeasured1 of 1: _find_python_docstring_block4
test_docstring_satisfies_req_tagpassedmeasured1 of 1: _find_python_docstring_block7
test_docstring_tags_satisfy_presencepassedmeasured1 of 1: _find_python_docstring_block7
test_docstring_tags_via_regex_parserpassedmeasured1 of 1: _find_python_docstring_block7
test_doxygen_associated_correctlypassedmeasured1 of 1: _find_python_docstring_block7
test_empty_docstring_is_not_a_blockpassedmeasured1 of 1: _find_python_docstring_block7
test_finds_all_functionspassedmeasured1 of 1: _find_python_docstring_block7
test_presence_message_includes_return_for_non_voidpassedmeasured1 of 1: _find_python_docstring_block7
test_presence_message_omits_return_for_voidpassedmeasured1 of 1: _find_python_docstring_block7
test_presence_message_python_stylepassedmeasured1 of 1: _find_python_docstring_block7
test_prose_docstring_is_the_block_and_its_summary_the_briefpassedmeasured1 of 1: _find_python_docstring_block7
test_regular_comment_not_doxygenpassedmeasured1 of 1: _find_python_docstring_block7
test_single_line_docstring_with_tagspassedmeasured1 of 1: _find_python_docstring_block7
test_triple_hash_not_doxygenpassedmeasured1 of 1: _find_python_docstring_block7
test_undocumented_detectedpassedmeasured1 of 1: _find_python_docstring_block7
test_validate_file_pythonpassedmeasured1 of 1: _find_python_docstring_block7
test_class_level_block_does_not_leak_to_first_methodpassedmeasured1 of 1: _find_python_docstring_block8
test_a_range_with_no_files_reads_the_files_the_range_changedpassedmeasured1 of 1: _find_python_docstring_block12
test_full_pipelinepassedmeasured1 of 1: _find_python_docstring_block12
Reached through calls

144 tests: 144 passed

144 passed
testresultlinked byimplementers exercisedcalls away
test_basic_c_functionpassedinferred1 of 1: _find_python_docstring_block4
test_basic_python_functionpassedinferred1 of 1: _find_python_docstring_block4
test_body_end_linepassedinferred1 of 1: _find_python_docstring_block4
test_cloud_fixturepassedinferred1 of 1: _find_python_docstring_block4
test_decorated_functionpassedinferred1 of 1: _find_python_docstring_block4
test_doxygen_tags_extractedpassedinferred1 of 1: _find_python_docstring_block4
test_exclude_namespassedinferred1 of 1: _find_python_docstring_block4
test_forward_declaration_excludedpassedinferred1 of 1: _find_python_docstring_block4
test_function_without_doxygenpassedinferred1 of 1: _find_python_docstring_block4
test_inline_constructorpassedinferred1 of 1: _find_python_docstring_block4
test_inline_destructorpassedinferred1 of 1: _find_python_docstring_block4
test_method_not_constructorpassedinferred1 of 1: _find_python_docstring_block4
test_multiple_functionspassedinferred1 of 1: _find_python_docstring_block4
test_out_of_line_constructorpassedinferred1 of 1: _find_python_docstring_block4
test_pairing_fixturepassedinferred1 of 1: _find_python_docstring_block4
test_standalone_function_no_enclosingpassedinferred1 of 1: _find_python_docstring_block4
test_static_functionpassedinferred1 of 1: _find_python_docstring_block4
test_struct_constructorpassedinferred1 of 1: _find_python_docstring_block4
test_the_gate_checks_mixin_members_and_stays_within_the_indexpassedinferred1 of 1: _find_python_docstring_block4
test_wifi_fixturepassedinferred1 of 1: _find_python_docstring_block4
test_a_blank_line_inside_the_run_ends_the_blockpassedinferred1 of 1: _find_python_docstring_block6
test_block_lines_are_zero_indexed_and_inclusivepassedinferred1 of 1: _find_python_docstring_block6
test_cfg_test_module_is_not_gatedpassedinferred1 of 1: _find_python_docstring_block6
test_doc_reaches_across_attributespassedinferred1 of 1: _find_python_docstring_block6
test_explicit_brief_wins_over_summarypassedinferred1 of 1: _find_python_docstring_block6
test_fixture_functions_and_blockspassedinferred1 of 1: _find_python_docstring_block6
test_functions_found_and_namedpassedinferred1 of 1: _find_python_docstring_block6
test_generic_impl_names_its_self_typepassedinferred1 of 1: _find_python_docstring_block6
test_jsdoc_is_found_above_export_and_constpassedinferred1 of 1: _find_python_docstring_block6
test_non_outer_doc_comments_are_not_blockspassedinferred1 of 1: _find_python_docstring_block6
test_plain_comment_is_not_jsdocpassedinferred1 of 1: _find_python_docstring_block6
test_return_annotation_decides_voidpassedinferred1 of 1: _find_python_docstring_block6
test_return_is_not_required_for_rustpassedinferred1 of 1: _find_python_docstring_block6
test_staleness_detects_an_unbumped_rust_bodypassedinferred1 of 1: _find_python_docstring_block6
test_summary_is_the_briefpassedinferred1 of 1: _find_python_docstring_block6
test_summary_paragraph_is_the_briefpassedinferred1 of 1: _find_python_docstring_block6
test_test_functions_are_not_gatedpassedinferred1 of 1: _find_python_docstring_block6
test_tsx_parses_jsxpassedinferred1 of 1: _find_python_docstring_block6
test_a_broken_toolchain_file_is_reported_not_fatalpassedinferred1 of 1: _find_python_docstring_block7
test_all_checks_runpassedinferred1 of 1: _find_python_docstring_block7
test_arbitrary_tags_are_parsedpassedinferred1 of 1: _find_python_docstring_block7
test_async_def_detectedpassedinferred1 of 1: _find_python_docstring_block7
test_attribute_inlinepassedinferred1 of 1: _find_python_docstring_block7
test_attribute_unusedpassedinferred1 of 1: _find_python_docstring_block7
test_attribute_visibility_hiddenpassedinferred1 of 1: _find_python_docstring_block7
test_bad_tags_all_failpassedinferred1 of 1: _find_python_docstring_block7
test_binary_named_as_source_is_skippedpassedinferred1 of 1: _find_python_docstring_block7
test_block_above_takes_precedence_over_docstringpassedinferred1 of 1: _find_python_docstring_block7
test_body_end_trackingpassedinferred1 of 1: _find_python_docstring_block7
test_braces_in_strings_body_endpassedinferred1 of 1: _find_python_docstring_block7
test_class_level_block_does_not_leak_to_first_memberpassedinferred1 of 1: _find_python_docstring_block7
test_class_qualified_methodpassedinferred1 of 1: _find_python_docstring_block7
test_clew_specific_ignores_apply_to_the_gatepassedinferred1 of 1: _find_python_docstring_block7
test_cpp_fixture_filepassedinferred1 of 1: _find_python_docstring_block7
test_custom_tag_single_linepassedinferred1 of 1: _find_python_docstring_block7
test_decorative_not_treated_as_doxygenpassedinferred1 of 1: _find_python_docstring_block7
test_decorative_triggers_presence_violationpassedinferred1 of 1: _find_python_docstring_block7
test_documented_file_no_violationspassedinferred1 of 1: _find_python_docstring_block7
test_double_star_still_matchespassedinferred1 of 1: _find_python_docstring_block7
test_excluded_filepassedinferred1 of 1: _find_python_docstring_block7
test_excluded_path_is_absent_and_gate_skips_itpassedinferred1 of 1: _find_python_docstring_block7
test_extern_c_linkagepassedinferred1 of 1: _find_python_docstring_block7
test_file_tag_in_prose_does_not_suppress_the_blockpassedinferred1 of 1: _find_python_docstring_block7
test_first_member_after_access_specifierpassedinferred1 of 1: _find_python_docstring_block7
test_first_member_with_no_access_specifierpassedinferred1 of 1: _find_python_docstring_block7
test_first_method_version_is_its_ownpassedinferred1 of 1: _find_python_docstring_block7
test_fixture_violationspassedinferred1 of 1: _find_python_docstring_block7
test_forward_declarations_are_always_skippedpassedinferred1 of 1: _find_python_docstring_block7
test_forward_declarations_skippedpassedinferred1 of 1: _find_python_docstring_block7
test_fully_documented_pythonpassedinferred1 of 1: _find_python_docstring_block7
test_good_tags_all_passpassedinferred1 of 1: _find_python_docstring_block7
test_inline_typedef_returnpassedinferred1 of 1: _find_python_docstring_block7
test_inner_doc_satisfies_the_file_block_without_at_filepassedinferred1 of 1: _find_python_docstring_block7
test_javascript_extensionspassedinferred1 of 1: _find_python_docstring_block7
test_lowercase_typedef_returnpassedinferred1 of 1: _find_python_docstring_block7
test_missing_file_block_suggests_inner_docpassedinferred1 of 1: _find_python_docstring_block7
test_modified_overload_flags_only_that_overloadpassedinferred1 of 1: _find_python_docstring_block7
test_multiline_attribute_is_handled_correctlypassedinferred1 of 1: _find_python_docstring_block7
test_multiline_tagspassedinferred1 of 1: _find_python_docstring_block7
test_namespaced_return_typepassedinferred1 of 1: _find_python_docstring_block7
test_nested_lookalike_path_agreespassedinferred1 of 1: _find_python_docstring_block7
test_no_false_positivespassedinferred1 of 1: _find_python_docstring_block7
test_no_false_positives_with_attributespassedinferred1 of 1: _find_python_docstring_block7
test_only_definitions_checkedpassedinferred1 of 1: _find_python_docstring_block7
test_opt_inpassedinferred1 of 1: _find_python_docstring_block7
test_presence_message_c_style_for_c_filepassedinferred1 of 1: _find_python_docstring_block7
test_require_return_bites_only_on_valued_annotationspassedinferred1 of 1: _find_python_docstring_block7
test_return_requirement_can_be_turned_back_onpassedinferred1 of 1: _find_python_docstring_block7
test_rust_is_opt_inpassedinferred1 of 1: _find_python_docstring_block7
test_simple_c_filepassedinferred1 of 1: _find_python_docstring_block7
test_single_line_doxygenpassedinferred1 of 1: _find_python_docstring_block7
test_stale_version_detectedpassedinferred1 of 1: _find_python_docstring_block7
test_static_macro_qualifierpassedinferred1 of 1: _find_python_docstring_block7
test_struct_qualified_returnpassedinferred1 of 1: _find_python_docstring_block7
test_tags_parsed_correctlypassedinferred1 of 1: _find_python_docstring_block7
test_three_tags_single_linepassedinferred1 of 1: _find_python_docstring_block7
test_toolchain_ignore_paths_skip_validationpassedinferred1 of 1: _find_python_docstring_block7
test_tsx_file_uses_typescript_configpassedinferred1 of 1: _find_python_docstring_block7
test_typedef_pointer_returnpassedinferred1 of 1: _find_python_docstring_block7
test_unbalanced_string_brace_is_handled_correctlypassedinferred1 of 1: _find_python_docstring_block7
test_undocumented_definition_after_declpassedinferred1 of 1: _find_python_docstring_block7
test_undocumented_typedef_detectedpassedinferred1 of 1: _find_python_docstring_block7
test_unknown_extension_skippedpassedinferred1 of 1: _find_python_docstring_block7
test_unmodified_overloads_no_violationpassedinferred1 of 1: _find_python_docstring_block7
test_updated_version_no_violationpassedinferred1 of 1: _find_python_docstring_block7
test_violationspassedinferred1 of 1: _find_python_docstring_block7
test_weak_macro_qualifierpassedinferred1 of 1: _find_python_docstring_block7
test_without_toolchain_files_everything_is_checkedpassedinferred1 of 1: _find_python_docstring_block7
test_a_changed_signature_with_a_bump_is_cleanpassedinferred1 of 1: _find_python_docstring_block8
test_a_changed_signature_without_a_bump_is_stalepassedinferred1 of 1: _find_python_docstring_block8
test_a_cpp_member_declaration_is_checked_toopassedinferred1 of 1: _find_python_docstring_block8
test_a_dead_req_on_a_documented_declaration_is_refusedpassedinferred1 of 1: _find_python_docstring_block8
test_a_declaration_does_not_need_its_own_reqpassedinferred1 of 1: _find_python_docstring_block8
test_a_documented_declaration_needs_its_versionpassedinferred1 of 1: _find_python_docstring_block8
test_added_copy_leaves_existing_copies_cleanpassedinferred1 of 1: _find_python_docstring_block8
test_an_overload_set_keeps_the_exact_matchpassedinferred1 of 1: _find_python_docstring_block8
test_an_undocumented_declaration_is_not_a_findingpassedinferred1 of 1: _find_python_docstring_block8
test_dg_internal_is_refused_naming_its_replacementpassedinferred1 of 1: _find_python_docstring_block8
test_excludes_are_globs_and_a_regex_says_sopassedinferred1 of 1: _find_python_docstring_block8
test_first_copy_edited_with_bump_is_cleanpassedinferred1 of 1: _find_python_docstring_block8
test_first_copy_edited_without_bump_differing_versions_is_flaggedpassedinferred1 of 1: _find_python_docstring_block8
test_first_method_after_class_docstring_still_foundpassedinferred1 of 1: _find_python_docstring_block8
test_first_method_directly_after_class_linepassedinferred1 of 1: _find_python_docstring_block8
test_guard_knows_the_tag_and_refuses_an_undeclared_idpassedinferred1 of 1: _find_python_docstring_block8
test_guard_refuses_a_marker_naming_an_undeclared_modepassedinferred1 of 1: _find_python_docstring_block8
test_later_method_still_foundpassedinferred1 of 1: _find_python_docstring_block8
test_nested_class_first_methodpassedinferred1 of 1: _find_python_docstring_block8
test_removed_copy_leaves_remaining_copy_cleanpassedinferred1 of 1: _find_python_docstring_block8
test_second_copy_edited_without_bump_is_flagged_alonepassedinferred1 of 1: _find_python_docstring_block8
test_the_refusal_survives_known_tags_warn_offpassedinferred1 of 1: _find_python_docstring_block8
test_unchanged_separate_ifdef_blocks_are_cleanpassedinferred1 of 1: _find_python_docstring_block8
test_unsupported_extension_returns_nonepassedinferred1 of 1: _find_python_docstring_block8
test_utility_is_acceptedpassedinferred1 of 1: _find_python_docstring_block8
test_a_requirement_implemented_by_a_dependency_at_its_pin_is_covered_via_itpassedinferred1 of 1: _find_python_docstring_block10
test_a_submodule_in_the_range_is_an_unmapped_file_never_openedpassedinferred1 of 1: _find_python_docstring_block10
test_an_exempt_status_is_listed_not_counted_as_a_gappassedinferred1 of 1: _find_python_docstring_block10
test_analyze_coverage_structurepassedinferred1 of 1: _find_python_docstring_block10
test_coverage_treats_a_declaration_and_its_definition_as_onepassedinferred1 of 1: _find_python_docstring_block10
test_covering_tests_are_read_from_the_test_treepassedinferred1 of 1: _find_python_docstring_block10
test_off_by_default_nothing_changespassedinferred1 of 1: _find_python_docstring_block10
test_without_exempt_status_nothing_is_exemptpassedinferred1 of 1: _find_python_docstring_block10
test_finds_changed_functionpassedinferred1 of 1: _find_python_docstring_block11
test_no_change_no_resultpassedinferred1 of 1: _find_python_docstring_block11
test_with_every_gap_exempt_the_gate_passes_and_still_names_thempassedinferred1 of 1: _find_python_docstring_block11

Flows through it