REQ-DDB-GUARD-020: Tree-sitter function indexing

← Requirements

What it requires

  1. Functions detected via AST node types including template_declaration and decorated_definition wrappers; doxygen blocks associated via prev_sibling with correct handling of comment styles per language
tier
PASS
declared
implemented
priority
P1

Where it lives

  • Guard: the pre-commit gate12

See it on the map

How it is met

implemented byresults (233 tests)_append_declaration_collect_functions_extract_signature_find_preceding_doxygen_resolve_comment_node_resolve_function_node_substrate_extension_tableget_language_specget_parser_for_languagelanguage_for_extensionlanguage_for_fileparse_functions_ts233 passed233 tests, a summary by result: every test is in the tests table below

Show on the map

Implemented by

Tests (233)

Linked directly

225 tests: 225 passed

225 passed
testresultlinked byimplementers exercisedcalls away
test_a_non_void_return_type_on_its_own_line_still_needs_onepassedmeasured11 of 12—
test_a_void_return_type_on_its_own_line_needs_no_return_tagpassedmeasured11 of 12—
test_impact_no_files_returns_0passedmeasured11 of 12—
test_a_checked_tree_says_nothing_extrapassedmeasured10 of 12—
test_a_configured_language_is_not_reportedpassedmeasured10 of 12—
test_a_namespaced_satisfies_id_resolves_by_its_bare_idpassedmeasured10 of 12—
test_a_pinned_external_catalogue_is_read_at_its_revisionpassedmeasured10 of 12—
test_a_ratio_at_or_above_the_floor_passespassedmeasured10 of 12—
test_a_ratio_below_the_declared_floor_failspassedmeasured10 of 12—
test_a_symlinked_impact_directory_is_refusedpassedmeasured10 of 12—
test_a_tag_with_no_catalogue_to_check_it_is_reportedpassedmeasured10 of 12—
test_an_external_catalogue_satisfies_cross_reference_without_a_local_onepassedmeasured10 of 12—
test_custom_configpassedmeasured10 of 12—
test_default_subcommand_with_filespassedmeasured10 of 12—
test_literal_version_resolvespassedmeasured10 of 12—
test_precommit_with_impactpassedmeasured10 of 12—
test_the_counts_are_printed_and_tests_are_left_outpassedmeasured10 of 12—
test_the_gate_refuses_a_satisfies_id_no_catalogue_holdspassedmeasured10 of 12—
test_the_pre_commit_hook_runs_the_coverage_gatepassedmeasured10 of 12—
test_validate_clean_filepassedmeasured10 of 12—
test_validate_dirty_filepassedmeasured10 of 12—
test_verbose_flagpassedmeasured10 of 12—
test_precommit_mode_flags_a_stale_rust_functionpassedmeasured9 of 12—
test_validate_writes_the_format_to_stdout_and_keeps_the_exit_codepassedmeasured9 of 12—
test_unchanged_ifdef_else_duplicate_is_cleanpassedmeasured8 of 12—
test_a_clean_repo_passespassedmeasured7 of 12—
test_an_excluded_file_is_counted_as_not_checkedpassedmeasured7 of 12—
test_a_body_edit_is_applied_in_place_and_disclosedpassedmeasured4 of 12: _extract_signature, _find_preceding_doxygen, _resolve_comment_node, _resolve_function_node—
test_a_component_wrapped_in_forwardref_or_memo_is_a_definitionpassedmeasured4 of 12: _extract_signature, _find_preceding_doxygen, _resolve_comment_node, _resolve_function_node—
test_a_fast_refresh_does_not_poison_the_full_build_that_followspassedmeasured4 of 12: _extract_signature, _find_preceding_doxygen, _resolve_comment_node, _resolve_function_node—
test_a_full_build_clears_the_fast_recordpassedmeasured4 of 12: _extract_signature, _find_preceding_doxygen, _resolve_comment_node, _resolve_function_node—
test_a_js_files_module_row_spans_the_new_filepassedmeasured4 of 12: _extract_signature, _find_preceding_doxygen, _resolve_comment_node, _resolve_function_node—
test_a_mixin_class_extends_its_declared_constraint_typepassedmeasured4 of 12: _extract_signature, _find_preceding_doxygen, _resolve_comment_node, _resolve_function_node—
test_a_mixin_composed_class_has_its_argument_classes_as_basespassedmeasured4 of 12: _extract_signature, _find_preceding_doxygen, _resolve_comment_node, _resolve_function_node—
test_a_removed_function_leaves_no_row_and_no_dangling_referencepassedmeasured4 of 12: _extract_signature, _find_preceding_doxygen, _resolve_comment_node, _resolve_function_node—
test_a_renamed_function_is_the_old_removed_and_the_new_addedpassedmeasured4 of 12: _extract_signature, _find_preceding_doxygen, _resolve_comment_node, _resolve_function_node—
test_an_added_class_still_takes_the_full_buildpassedmeasured4 of 12: _extract_signature, _find_preceding_doxygen, _resolve_comment_node, _resolve_function_node—
test_an_added_function_is_refreshed_in_placepassedmeasured4 of 12: _extract_signature, _find_preceding_doxygen, _resolve_comment_node, _resolve_function_node—
test_definitions_functions_and_classespassedmeasured4 of 12: _extract_signature, _find_preceding_doxygen, _resolve_comment_node, _resolve_function_node—
test_definitions_in_plain_javascript_and_tsxpassedmeasured4 of 12: _extract_signature, _find_preceding_doxygen, _resolve_comment_node, _resolve_function_node—
test_editing_one_typescript_file_reparses_only_that_filepassedmeasured4 of 12: _extract_signature, _find_preceding_doxygen, _resolve_comment_node, _resolve_function_node—
test_interface_members_are_declarationspassedmeasured4 of 12: _extract_signature, _find_preceding_doxygen, _resolve_comment_node, _resolve_function_node—
test_mixin_members_are_definitions_of_a_class_named_for_its_bindingpassedmeasured4 of 12: _extract_signature, _find_preceding_doxygen, _resolve_comment_node, _resolve_function_node—
test_nested_functions_are_definitions_under_their_enclosing_functionpassedmeasured4 of 12: _extract_signature, _find_preceding_doxygen, _resolve_comment_node, _resolve_function_node—
test_object_literal_functions_are_definitionspassedmeasured4 of 12: _extract_signature, _find_preceding_doxygen, _resolve_comment_node, _resolve_function_node—
test_the_edited_files_code_text_is_currentpassedmeasured4 of 12: _extract_signature, _find_preceding_doxygen, _resolve_comment_node, _resolve_function_node—
test_the_edited_files_outgoing_calls_are_currentpassedmeasured4 of 12: _extract_signature, _find_preceding_doxygen, _resolve_comment_node, _resolve_function_node—
test_the_edited_files_text_layers_are_currentpassedmeasured4 of 12: _extract_signature, _find_preceding_doxygen, _resolve_comment_node, _resolve_function_node—
test_two_fast_refreshes_of_one_file_match_a_full_buildpassedmeasured4 of 12: _extract_signature, _find_preceding_doxygen, _resolve_comment_node, _resolve_function_node—
test_typescript_cached_output_matches_no_cachepassedmeasured4 of 12: _extract_signature, _find_preceding_doxygen, _resolve_comment_node, _resolve_function_node—
test_a_dependency_base_does_not_link_to_a_local_classpassedmeasured3 of 12: _find_preceding_doxygen, _resolve_comment_node, _resolve_function_node—
test_a_relative_alias_or_undeclared_base_still_linkspassedmeasured3 of 12: _find_preceding_doxygen, _resolve_comment_node, _resolve_function_node—
test_tsx_file_uses_typescript_configpassedmeasured10 of 121
test_forward_declaration_excludedpassedmeasured9 of 121
test_out_of_line_constructorpassedmeasured9 of 121
test_basic_c_functionpassedmeasured8 of 121
test_body_end_linepassedmeasured8 of 121
test_cloud_fixturepassedmeasured8 of 121
test_doxygen_tags_extractedpassedmeasured8 of 121
test_exclude_namespassedmeasured8 of 121
test_function_without_doxygenpassedmeasured8 of 121
test_inline_constructorpassedmeasured8 of 121
test_inline_destructorpassedmeasured8 of 121
test_method_not_constructorpassedmeasured8 of 121
test_multiple_functionspassedmeasured8 of 121
test_pairing_fixturepassedmeasured8 of 121
test_standalone_function_no_enclosingpassedmeasured8 of 121
test_static_functionpassedmeasured8 of 121
test_struct_constructorpassedmeasured8 of 121
test_the_gate_checks_mixin_members_and_stays_within_the_indexpassedmeasured8 of 121
test_wifi_fixturepassedmeasured8 of 121
test_basic_python_functionpassedmeasured7 of 121
test_decorated_functionpassedmeasured7 of 121
test_python_body_endpassedmeasured7 of 121
test_python_no_doxygenpassedmeasured7 of 121
test_h_file_with_class_detected_as_cpppassedmeasured2 of 12: language_for_extension, language_for_file1
test_h_file_with_namespace_detected_as_cpppassedmeasured2 of 12: language_for_extension, language_for_file1
test_h_file_with_template_detected_as_cpppassedmeasured2 of 12: language_for_extension, language_for_file1
test_language_for_file_unknownpassedmeasured2 of 12: language_for_extension, language_for_file1
test_language_for_file_with_configpassedmeasured2 of 12: language_for_extension, language_for_file1
test_languages_without_a_spec_are_not_mappedpassedmeasured2 of 12: language_for_extension, language_for_file1
test_plain_c_h_file_stays_cpassedmeasured2 of 12: language_for_extension, language_for_file1
test_tsx_is_routed_to_the_jsx_aware_grammarpassedmeasured2 of 12: language_for_extension, language_for_file1
test_c_extensionspassedmeasured1 of 12: language_for_extension1
test_c_parser_produces_treepassedmeasured1 of 12: get_parser_for_language1
test_c_spec_has_function_definitionpassedmeasured1 of 12: get_language_spec1
test_cpp_extensionspassedmeasured1 of 12: language_for_extension1
test_cpp_parser_produces_treepassedmeasured1 of 12: get_parser_for_language1
test_python_extensionpassedmeasured1 of 12: language_for_extension1
test_python_parser_produces_treepassedmeasured1 of 12: get_parser_for_language1
test_unknown_extensionpassedmeasured1 of 12: language_for_extension1
test_unknown_language_returns_nonepassedmeasured1 of 12: get_parser_for_language1
test_staleness_detects_an_unbumped_rust_bodypassedmeasured9 of 122
test_only_definitions_checkedpassedmeasured11 of 123
test_a_broken_toolchain_file_is_reported_not_fatalpassedmeasured10 of 123
test_all_checks_runpassedmeasured10 of 123
test_clew_specific_ignores_apply_to_the_gatepassedmeasured10 of 123
test_decorative_triggers_presence_violationpassedmeasured10 of 123
test_documented_file_no_violationspassedmeasured10 of 123
test_excluded_path_is_absent_and_gate_skips_itpassedmeasured10 of 123
test_javascript_extensionspassedmeasured10 of 123
test_nested_lookalike_path_agreespassedmeasured10 of 123
test_no_false_positivespassedmeasured10 of 123
test_no_false_positives_with_attributespassedmeasured10 of 123
test_presence_message_c_style_for_c_filepassedmeasured10 of 123
test_require_return_bites_only_on_valued_annotationspassedmeasured10 of 123
test_toolchain_ignore_paths_skip_validationpassedmeasured10 of 123
test_violationspassedmeasured10 of 123
test_without_toolchain_files_everything_is_checkedpassedmeasured10 of 123
test_docstring_satisfies_req_tagpassedmeasured9 of 123
test_docstring_tags_satisfy_presencepassedmeasured9 of 123
test_fixture_violationspassedmeasured9 of 123
test_fully_documented_pythonpassedmeasured9 of 123
test_inner_doc_satisfies_the_file_block_without_at_filepassedmeasured9 of 123
test_missing_file_block_suggests_inner_docpassedmeasured9 of 123
test_presence_message_includes_return_for_non_voidpassedmeasured9 of 123
test_presence_message_omits_return_for_voidpassedmeasured9 of 123
test_presence_message_python_stylepassedmeasured9 of 123
test_return_is_not_required_for_rustpassedmeasured9 of 123
test_return_requirement_can_be_turned_back_onpassedmeasured9 of 123
test_validate_file_pythonpassedmeasured9 of 123
test_functions_found_and_namedpassedmeasured8 of 123
test_jsdoc_is_found_above_export_and_constpassedmeasured8 of 123
test_plain_comment_is_not_jsdocpassedmeasured8 of 123
test_return_annotation_decides_voidpassedmeasured8 of 123
test_summary_is_the_briefpassedmeasured8 of 123
test_tsx_parses_jsxpassedmeasured8 of 123
test_a_blank_line_inside_the_run_ends_the_blockpassedmeasured7 of 123
test_block_lines_are_zero_indexed_and_inclusivepassedmeasured7 of 123
test_doc_reaches_across_attributespassedmeasured7 of 123
test_explicit_brief_wins_over_summarypassedmeasured7 of 123
test_fixture_functions_and_blockspassedmeasured7 of 123
test_generic_impl_names_its_self_typepassedmeasured7 of 123
test_non_outer_doc_comments_are_not_blockspassedmeasured7 of 123
test_summary_paragraph_is_the_briefpassedmeasured7 of 123
test_cfg_test_module_is_not_gatedpassedmeasured5 of 123
test_test_functions_are_not_gatedpassedmeasured5 of 123
test_a_cpp_member_declaration_is_checked_toopassedmeasured11 of 124
test_a_dead_req_on_a_documented_declaration_is_refusedpassedmeasured11 of 124
test_a_declaration_does_not_need_its_own_reqpassedmeasured11 of 124
test_a_documented_declaration_needs_its_versionpassedmeasured11 of 124
test_an_undocumented_declaration_is_not_a_findingpassedmeasured10 of 124
test_excludes_are_globs_and_a_regex_says_sopassedmeasured10 of 124
test_class_level_block_does_not_leak_to_first_methodpassedmeasured9 of 124
test_first_method_after_class_docstring_still_foundpassedmeasured9 of 124
test_first_method_directly_after_class_linepassedmeasured9 of 124
test_forward_declarations_are_always_skippedpassedmeasured9 of 124
test_forward_declarations_skippedpassedmeasured9 of 124
test_guard_knows_the_tag_and_refuses_an_undeclared_idpassedmeasured9 of 124
test_guard_refuses_a_marker_naming_an_undeclared_modepassedmeasured9 of 124
test_later_method_still_foundpassedmeasured9 of 124
test_nested_class_first_methodpassedmeasured9 of 124
test_undocumented_definition_after_declpassedmeasured9 of 124
test_arbitrary_tags_are_parsedpassedmeasured8 of 124
test_attribute_inlinepassedmeasured8 of 124
test_attribute_unusedpassedmeasured8 of 124
test_attribute_visibility_hiddenpassedmeasured8 of 124
test_bad_tags_all_failpassedmeasured8 of 124
test_body_end_trackingpassedmeasured8 of 124
test_braces_in_strings_body_endpassedmeasured8 of 124
test_class_level_block_does_not_leak_to_first_memberpassedmeasured8 of 124
test_class_qualified_methodpassedmeasured8 of 124
test_cpp_fixture_filepassedmeasured8 of 124
test_decorative_not_treated_as_doxygenpassedmeasured8 of 124
test_double_star_still_matchespassedmeasured8 of 124
test_extern_c_linkagepassedmeasured8 of 124
test_first_member_after_access_specifierpassedmeasured8 of 124
test_first_member_with_no_access_specifierpassedmeasured8 of 124
test_good_tags_all_passpassedmeasured8 of 124
test_inline_typedef_returnpassedmeasured8 of 124
test_lowercase_typedef_returnpassedmeasured8 of 124
test_modified_overload_flags_only_that_overloadpassedmeasured8 of 124
test_multiline_attribute_is_handled_correctlypassedmeasured8 of 124
test_namespaced_return_typepassedmeasured8 of 124
test_simple_c_filepassedmeasured8 of 124
test_stale_version_detectedpassedmeasured8 of 124
test_static_macro_qualifierpassedmeasured8 of 124
test_struct_qualified_returnpassedmeasured8 of 124
test_tags_parsed_correctlypassedmeasured8 of 124
test_typedef_pointer_returnpassedmeasured8 of 124
test_unbalanced_string_brace_is_handled_correctlypassedmeasured8 of 124
test_undocumented_detectedpassedmeasured8 of 124
test_undocumented_typedef_detectedpassedmeasured8 of 124
test_unmodified_overloads_no_violationpassedmeasured8 of 124
test_updated_version_no_violationpassedmeasured8 of 124
test_weak_macro_qualifierpassedmeasured8 of 124
test_async_def_detectedpassedmeasured7 of 124
test_block_above_takes_precedence_over_docstringpassedmeasured7 of 124
test_custom_tag_single_linepassedmeasured7 of 124
test_docstring_tags_via_regex_parserpassedmeasured7 of 124
test_doxygen_associated_correctlypassedmeasured7 of 124
test_empty_docstring_is_not_a_blockpassedmeasured7 of 124
test_file_tag_in_prose_does_not_suppress_the_blockpassedmeasured7 of 124
test_finds_all_functionspassedmeasured7 of 124
test_first_method_version_is_its_ownpassedmeasured7 of 124
test_multiline_tagspassedmeasured7 of 124
test_prose_docstring_is_the_block_and_its_summary_the_briefpassedmeasured7 of 124
test_regular_comment_not_doxygenpassedmeasured7 of 124
test_single_line_docstring_with_tagspassedmeasured7 of 124
test_single_line_doxygenpassedmeasured7 of 124
test_three_tags_single_linepassedmeasured7 of 124
test_triple_hash_not_doxygenpassedmeasured7 of 124
test_a_changed_signature_with_a_bump_is_cleanpassedmeasured8 of 125
test_a_changed_signature_without_a_bump_is_stalepassedmeasured8 of 125
test_added_copy_leaves_existing_copies_cleanpassedmeasured8 of 125
test_an_overload_set_keeps_the_exact_matchpassedmeasured8 of 125
test_dg_internal_is_refused_naming_its_replacementpassedmeasured8 of 125
test_first_copy_edited_with_bump_is_cleanpassedmeasured8 of 125
test_first_copy_edited_without_bump_differing_versions_is_flaggedpassedmeasured8 of 125
test_removed_copy_leaves_remaining_copy_cleanpassedmeasured8 of 125
test_second_copy_edited_without_bump_is_flagged_alonepassedmeasured8 of 125
test_the_refusal_survives_known_tags_warn_offpassedmeasured8 of 125
test_unchanged_separate_ifdef_blocks_are_cleanpassedmeasured8 of 125
test_utility_is_acceptedpassedmeasured8 of 125
test_coverage_treats_a_declaration_and_its_definition_as_onepassedmeasured11 of 126
test_a_requirement_implemented_by_a_dependency_at_its_pin_is_covered_via_itpassedmeasured10 of 126
test_an_exempt_status_is_listed_not_counted_as_a_gappassedmeasured10 of 126
test_analyze_coverage_structurepassedmeasured10 of 126
test_off_by_default_nothing_changespassedmeasured10 of 126
test_without_exempt_status_nothing_is_exemptpassedmeasured10 of 126
test_covering_tests_are_read_from_the_test_treepassedmeasured9 of 126
test_finds_changed_functionpassedmeasured10 of 127
test_with_every_gap_exempt_the_gate_passes_and_still_names_thempassedmeasured10 of 127
test_a_range_with_no_files_reads_the_files_the_range_changedpassedmeasured11 of 128
test_full_pipelinepassedmeasured11 of 128
Reached through calls

8 tests: 8 passed

8 passed
testresultlinked byimplementers exercisedcalls away
test_binary_named_as_source_is_skippedpassedinferred11 of 123
test_excluded_filepassedinferred11 of 123
test_opt_inpassedinferred11 of 123
test_rust_is_opt_inpassedinferred11 of 123
test_unknown_extension_skippedpassedinferred11 of 123
test_unsupported_extension_returns_nonepassedinferred11 of 124
test_a_submodule_in_the_range_is_an_unmapped_file_never_openedpassedinferred11 of 126
test_no_change_no_resultpassedinferred11 of 127

Flows through it