REQ-DDB-GUARD-025: JavaScript and TypeScript (JSDoc) functions are gated when a repo declares them¶
What it requires
- With
validate.languages.javascript/typescriptdeclared, function and generator declarations, methods, and names bound to an arrow function or function expression (const f = () => ..., a class field) carry a/** */JSDoc block, found above theexport/constaround them. - The JSDoc summary satisfies @brief unless @brief is written. @return is not required unless
require_returnis true, and then only for a TypeScript return annotation other than void, never, undefined or Promise of those. - Anonymous functions and bodiless signatures are not gated;
.tsxparses with the JSX-aware grammar. - Undeclared, these files are not checked.
- tier
- PASS
- declared
- implemented
- priority
- P1
How it is met
Implemented by
_bound_functionclew/guard/ts_parser.py:167_js_returns_voidclew/guard/ts_parser.py:759
Tests (214)
Linked directly
204 tests: 204 passed
204 passed
| test | result | linked by | implementers exercised | calls away |
|---|---|---|---|---|
test_a_body_edit_is_applied_in_place_and_disclosed | passed | measured | 1 of 2: _bound_function | — |
test_a_checked_tree_says_nothing_extra | passed | measured | 1 of 2: _bound_function | — |
test_a_component_wrapped_in_forwardref_or_memo_is_a_definition | passed | measured | 1 of 2: _bound_function | — |
test_a_configured_language_is_not_reported | passed | measured | 1 of 2: _bound_function | — |
test_a_dependency_base_does_not_link_to_a_local_class | passed | measured | 1 of 2: _bound_function | — |
test_a_fast_refresh_does_not_poison_the_full_build_that_follows | passed | measured | 1 of 2: _bound_function | — |
test_a_full_build_clears_the_fast_record | passed | measured | 1 of 2: _bound_function | — |
test_a_js_files_module_row_spans_the_new_file | passed | measured | 1 of 2: _bound_function | — |
test_a_mixin_class_extends_its_declared_constraint_type | passed | measured | 1 of 2: _bound_function | — |
test_a_mixin_composed_class_has_its_argument_classes_as_bases | passed | measured | 1 of 2: _bound_function | — |
test_a_namespaced_satisfies_id_resolves_by_its_bare_id | passed | measured | 1 of 2: _bound_function | — |
test_a_non_void_return_type_on_its_own_line_still_needs_one | passed | measured | 1 of 2: _bound_function | — |
test_a_pinned_external_catalogue_is_read_at_its_revision | passed | measured | 1 of 2: _bound_function | — |
test_a_ratio_at_or_above_the_floor_passes | passed | measured | 1 of 2: _bound_function | — |
test_a_ratio_below_the_declared_floor_fails | passed | measured | 1 of 2: _bound_function | — |
test_a_relative_alias_or_undeclared_base_still_links | passed | measured | 1 of 2: _bound_function | — |
test_a_removed_function_leaves_no_row_and_no_dangling_reference | passed | measured | 1 of 2: _bound_function | — |
test_a_renamed_function_is_the_old_removed_and_the_new_added | passed | measured | 1 of 2: _bound_function | — |
test_a_symlinked_impact_directory_is_refused | passed | measured | 1 of 2: _bound_function | — |
test_a_tag_with_no_catalogue_to_check_it_is_reported | passed | measured | 1 of 2: _bound_function | — |
test_a_void_return_type_on_its_own_line_needs_no_return_tag | passed | measured | 1 of 2: _bound_function | — |
test_an_added_class_still_takes_the_full_build | passed | measured | 1 of 2: _bound_function | — |
test_an_added_function_is_refreshed_in_place | passed | measured | 1 of 2: _bound_function | — |
test_an_external_catalogue_satisfies_cross_reference_without_a_local_one | passed | measured | 1 of 2: _bound_function | — |
test_custom_config | passed | measured | 1 of 2: _bound_function | — |
test_default_subcommand_with_files | passed | measured | 1 of 2: _bound_function | — |
test_definitions_functions_and_classes | passed | measured | 1 of 2: _bound_function | — |
test_definitions_in_plain_javascript_and_tsx | passed | measured | 1 of 2: _bound_function | — |
test_editing_one_typescript_file_reparses_only_that_file | passed | measured | 1 of 2: _bound_function | — |
test_impact_no_files_returns_0 | passed | measured | 1 of 2: _bound_function | — |
test_interface_members_are_declarations | passed | measured | 1 of 2: _bound_function | — |
test_literal_version_resolves | passed | measured | 1 of 2: _bound_function | — |
test_mixin_members_are_definitions_of_a_class_named_for_its_binding | passed | measured | 1 of 2: _bound_function | — |
test_nested_functions_are_definitions_under_their_enclosing_function | passed | measured | 1 of 2: _bound_function | — |
test_object_literal_functions_are_definitions | passed | measured | 1 of 2: _bound_function | — |
test_precommit_mode_flags_a_stale_rust_function | passed | measured | 1 of 2: _bound_function | — |
test_precommit_with_impact | passed | measured | 1 of 2: _bound_function | — |
test_the_counts_are_printed_and_tests_are_left_out | passed | measured | 1 of 2: _bound_function | — |
test_the_edited_files_code_text_is_current | passed | measured | 1 of 2: _bound_function | — |
test_the_edited_files_outgoing_calls_are_current | passed | measured | 1 of 2: _bound_function | — |
test_the_edited_files_text_layers_are_current | passed | measured | 1 of 2: _bound_function | — |
test_the_gate_refuses_a_satisfies_id_no_catalogue_holds | passed | measured | 1 of 2: _bound_function | — |
test_the_pre_commit_hook_runs_the_coverage_gate | passed | measured | 1 of 2: _bound_function | — |
test_two_fast_refreshes_of_one_file_match_a_full_build | passed | measured | 1 of 2: _bound_function | — |
test_typescript_cached_output_matches_no_cache | passed | measured | 1 of 2: _bound_function | — |
test_unchanged_ifdef_else_duplicate_is_clean | passed | measured | 1 of 2: _bound_function | — |
test_validate_clean_file | passed | measured | 1 of 2: _bound_function | — |
test_validate_dirty_file | passed | measured | 1 of 2: _bound_function | — |
test_validate_writes_the_format_to_stdout_and_keeps_the_exit_code | passed | measured | 1 of 2: _bound_function | — |
test_verbose_flag | passed | measured | 1 of 2: _bound_function | — |
test_the_gate_checks_mixin_members_and_stays_within_the_index | passed | measured | 2 of 2: _bound_function, _js_returns_void | 3 |
test_basic_c_function | passed | measured | 1 of 2: _bound_function | 3 |
test_basic_python_function | passed | measured | 1 of 2: _bound_function | 3 |
test_body_end_line | passed | measured | 1 of 2: _bound_function | 3 |
test_cloud_fixture | passed | measured | 1 of 2: _bound_function | 3 |
test_decorated_function | passed | measured | 1 of 2: _bound_function | 3 |
test_doxygen_tags_extracted | passed | measured | 1 of 2: _bound_function | 3 |
test_exclude_names | passed | measured | 1 of 2: _bound_function | 3 |
test_forward_declaration_excluded | passed | measured | 1 of 2: _bound_function | 3 |
test_function_without_doxygen | passed | measured | 1 of 2: _bound_function | 3 |
test_inline_constructor | passed | measured | 1 of 2: _bound_function | 3 |
test_inline_destructor | passed | measured | 1 of 2: _bound_function | 3 |
test_method_not_constructor | passed | measured | 1 of 2: _bound_function | 3 |
test_multiple_functions | passed | measured | 1 of 2: _bound_function | 3 |
test_out_of_line_constructor | passed | measured | 1 of 2: _bound_function | 3 |
test_pairing_fixture | passed | measured | 1 of 2: _bound_function | 3 |
test_python_body_end | passed | measured | 1 of 2: _bound_function | 3 |
test_python_no_doxygen | passed | measured | 1 of 2: _bound_function | 3 |
test_standalone_function_no_enclosing | passed | measured | 1 of 2: _bound_function | 3 |
test_static_function | passed | measured | 1 of 2: _bound_function | 3 |
test_struct_constructor | passed | measured | 1 of 2: _bound_function | 3 |
test_wifi_fixture | passed | measured | 1 of 2: _bound_function | 3 |
test_functions_found_and_named | passed | measured | 2 of 2: _bound_function, _js_returns_void | 5 |
test_jsdoc_is_found_above_export_and_const | passed | measured | 2 of 2: _bound_function, _js_returns_void | 5 |
test_plain_comment_is_not_jsdoc | passed | measured | 2 of 2: _bound_function, _js_returns_void | 5 |
test_return_annotation_decides_void | passed | measured | 2 of 2: _bound_function, _js_returns_void | 5 |
test_summary_is_the_brief | passed | measured | 2 of 2: _bound_function, _js_returns_void | 5 |
test_tsx_parses_jsx | passed | measured | 2 of 2: _bound_function, _js_returns_void | 5 |
test_a_blank_line_inside_the_run_ends_the_block | passed | measured | 1 of 2: _bound_function | 5 |
test_block_lines_are_zero_indexed_and_inclusive | passed | measured | 1 of 2: _bound_function | 5 |
test_doc_reaches_across_attributes | passed | measured | 1 of 2: _bound_function | 5 |
test_explicit_brief_wins_over_summary | passed | measured | 1 of 2: _bound_function | 5 |
test_fixture_functions_and_blocks | passed | measured | 1 of 2: _bound_function | 5 |
test_generic_impl_names_its_self_type | passed | measured | 1 of 2: _bound_function | 5 |
test_non_outer_doc_comments_are_not_blocks | passed | measured | 1 of 2: _bound_function | 5 |
test_return_is_not_required_for_rust | passed | measured | 1 of 2: _bound_function | 5 |
test_staleness_detects_an_unbumped_rust_body | passed | measured | 1 of 2: _bound_function | 5 |
test_summary_paragraph_is_the_brief | passed | measured | 1 of 2: _bound_function | 5 |
test_javascript_extensions | passed | measured | 2 of 2: _bound_function, _js_returns_void | 6 |
test_opt_in | passed | catalog | 2 of 2: _bound_function, _js_returns_void | 6 |
test_require_return_bites_only_on_valued_annotations | passed | measured | 2 of 2: _bound_function, _js_returns_void | 6 |
test_tsx_file_uses_typescript_config | passed | measured | 2 of 2: _bound_function, _js_returns_void | 6 |
test_violations | passed | measured | 2 of 2: _bound_function, _js_returns_void | 6 |
test_a_broken_toolchain_file_is_reported_not_fatal | passed | measured | 1 of 2: _bound_function | 6 |
test_all_checks_run | passed | measured | 1 of 2: _bound_function | 6 |
test_arbitrary_tags_are_parsed | passed | measured | 1 of 2: _bound_function | 6 |
test_async_def_detected | passed | measured | 1 of 2: _bound_function | 6 |
test_attribute_inline | passed | measured | 1 of 2: _bound_function | 6 |
test_attribute_unused | passed | measured | 1 of 2: _bound_function | 6 |
test_attribute_visibility_hidden | passed | measured | 1 of 2: _bound_function | 6 |
test_bad_tags_all_fail | passed | measured | 1 of 2: _bound_function | 6 |
test_block_above_takes_precedence_over_docstring | passed | measured | 1 of 2: _bound_function | 6 |
test_body_end_tracking | passed | measured | 1 of 2: _bound_function | 6 |
test_braces_in_strings_body_end | passed | measured | 1 of 2: _bound_function | 6 |
test_class_level_block_does_not_leak_to_first_member | passed | measured | 1 of 2: _bound_function | 6 |
test_class_qualified_method | passed | measured | 1 of 2: _bound_function | 6 |
test_clew_specific_ignores_apply_to_the_gate | passed | measured | 1 of 2: _bound_function | 6 |
test_cpp_fixture_file | passed | measured | 1 of 2: _bound_function | 6 |
test_custom_tag_single_line | passed | measured | 1 of 2: _bound_function | 6 |
test_decorative_not_treated_as_doxygen | passed | measured | 1 of 2: _bound_function | 6 |
test_decorative_triggers_presence_violation | passed | measured | 1 of 2: _bound_function | 6 |
test_docstring_satisfies_req_tag | passed | measured | 1 of 2: _bound_function | 6 |
test_docstring_tags_satisfy_presence | passed | measured | 1 of 2: _bound_function | 6 |
test_docstring_tags_via_regex_parser | passed | measured | 1 of 2: _bound_function | 6 |
test_documented_file_no_violations | passed | measured | 1 of 2: _bound_function | 6 |
test_double_star_still_matches | passed | measured | 1 of 2: _bound_function | 6 |
test_doxygen_associated_correctly | passed | measured | 1 of 2: _bound_function | 6 |
test_empty_docstring_is_not_a_block | passed | measured | 1 of 2: _bound_function | 6 |
test_excluded_path_is_absent_and_gate_skips_it | passed | measured | 1 of 2: _bound_function | 6 |
test_extern_c_linkage | passed | measured | 1 of 2: _bound_function | 6 |
test_file_tag_in_prose_does_not_suppress_the_block | passed | measured | 1 of 2: _bound_function | 6 |
test_finds_all_functions | passed | measured | 1 of 2: _bound_function | 6 |
test_first_member_after_access_specifier | passed | measured | 1 of 2: _bound_function | 6 |
test_first_member_with_no_access_specifier | passed | measured | 1 of 2: _bound_function | 6 |
test_first_method_version_is_its_own | passed | measured | 1 of 2: _bound_function | 6 |
test_fixture_violations | passed | measured | 1 of 2: _bound_function | 6 |
test_forward_declarations_are_always_skipped | passed | measured | 1 of 2: _bound_function | 6 |
test_forward_declarations_skipped | passed | measured | 1 of 2: _bound_function | 6 |
test_fully_documented_python | passed | measured | 1 of 2: _bound_function | 6 |
test_good_tags_all_pass | passed | measured | 1 of 2: _bound_function | 6 |
test_inline_typedef_return | passed | measured | 1 of 2: _bound_function | 6 |
test_inner_doc_satisfies_the_file_block_without_at_file | passed | measured | 1 of 2: _bound_function | 6 |
test_lowercase_typedef_return | passed | measured | 1 of 2: _bound_function | 6 |
test_missing_file_block_suggests_inner_doc | passed | measured | 1 of 2: _bound_function | 6 |
test_modified_overload_flags_only_that_overload | passed | measured | 1 of 2: _bound_function | 6 |
test_multiline_attribute_is_handled_correctly | passed | measured | 1 of 2: _bound_function | 6 |
test_multiline_tags | passed | measured | 1 of 2: _bound_function | 6 |
test_namespaced_return_type | passed | measured | 1 of 2: _bound_function | 6 |
test_nested_lookalike_path_agrees | passed | measured | 1 of 2: _bound_function | 6 |
test_no_false_positives | passed | measured | 1 of 2: _bound_function | 6 |
test_no_false_positives_with_attributes | passed | measured | 1 of 2: _bound_function | 6 |
test_only_definitions_checked | passed | measured | 1 of 2: _bound_function | 6 |
test_presence_message_c_style_for_c_file | passed | measured | 1 of 2: _bound_function | 6 |
test_presence_message_includes_return_for_non_void | passed | measured | 1 of 2: _bound_function | 6 |
test_presence_message_omits_return_for_void | passed | measured | 1 of 2: _bound_function | 6 |
test_presence_message_python_style | passed | measured | 1 of 2: _bound_function | 6 |
test_prose_docstring_is_the_block_and_its_summary_the_brief | passed | measured | 1 of 2: _bound_function | 6 |
test_regular_comment_not_doxygen | passed | measured | 1 of 2: _bound_function | 6 |
test_return_requirement_can_be_turned_back_on | passed | measured | 1 of 2: _bound_function | 6 |
test_simple_c_file | passed | measured | 1 of 2: _bound_function | 6 |
test_single_line_docstring_with_tags | passed | measured | 1 of 2: _bound_function | 6 |
test_single_line_doxygen | passed | measured | 1 of 2: _bound_function | 6 |
test_stale_version_detected | passed | measured | 1 of 2: _bound_function | 6 |
test_static_macro_qualifier | passed | measured | 1 of 2: _bound_function | 6 |
test_struct_qualified_return | passed | measured | 1 of 2: _bound_function | 6 |
test_tags_parsed_correctly | passed | measured | 1 of 2: _bound_function | 6 |
test_three_tags_single_line | passed | measured | 1 of 2: _bound_function | 6 |
test_toolchain_ignore_paths_skip_validation | passed | measured | 1 of 2: _bound_function | 6 |
test_triple_hash_not_doxygen | passed | measured | 1 of 2: _bound_function | 6 |
test_typedef_pointer_return | passed | measured | 1 of 2: _bound_function | 6 |
test_unbalanced_string_brace_is_handled_correctly | passed | measured | 1 of 2: _bound_function | 6 |
test_undocumented_definition_after_decl | passed | measured | 1 of 2: _bound_function | 6 |
test_undocumented_detected | passed | measured | 1 of 2: _bound_function | 6 |
test_undocumented_typedef_detected | passed | measured | 1 of 2: _bound_function | 6 |
test_unmodified_overloads_no_violation | passed | measured | 1 of 2: _bound_function | 6 |
test_updated_version_no_violation | passed | measured | 1 of 2: _bound_function | 6 |
test_validate_file_python | passed | measured | 1 of 2: _bound_function | 6 |
test_weak_macro_qualifier | passed | measured | 1 of 2: _bound_function | 6 |
test_without_toolchain_files_everything_is_checked | passed | measured | 1 of 2: _bound_function | 6 |
test_a_changed_signature_with_a_bump_is_clean | passed | measured | 1 of 2: _bound_function | 7 |
test_a_changed_signature_without_a_bump_is_stale | passed | measured | 1 of 2: _bound_function | 7 |
test_a_cpp_member_declaration_is_checked_too | passed | measured | 1 of 2: _bound_function | 7 |
test_a_dead_req_on_a_documented_declaration_is_refused | passed | measured | 1 of 2: _bound_function | 7 |
test_a_declaration_does_not_need_its_own_req | passed | measured | 1 of 2: _bound_function | 7 |
test_a_documented_declaration_needs_its_version | passed | measured | 1 of 2: _bound_function | 7 |
test_added_copy_leaves_existing_copies_clean | passed | measured | 1 of 2: _bound_function | 7 |
test_an_overload_set_keeps_the_exact_match | passed | measured | 1 of 2: _bound_function | 7 |
test_class_level_block_does_not_leak_to_first_method | passed | measured | 1 of 2: _bound_function | 7 |
test_dg_internal_is_refused_naming_its_replacement | passed | measured | 1 of 2: _bound_function | 7 |
test_excludes_are_globs_and_a_regex_says_so | passed | measured | 1 of 2: _bound_function | 7 |
test_first_copy_edited_with_bump_is_clean | passed | measured | 1 of 2: _bound_function | 7 |
test_first_copy_edited_without_bump_differing_versions_is_flagged | passed | measured | 1 of 2: _bound_function | 7 |
test_first_method_after_class_docstring_still_found | passed | measured | 1 of 2: _bound_function | 7 |
test_first_method_directly_after_class_line | passed | measured | 1 of 2: _bound_function | 7 |
test_guard_knows_the_tag_and_refuses_an_undeclared_id | passed | measured | 1 of 2: _bound_function | 7 |
test_guard_refuses_a_marker_naming_an_undeclared_mode | passed | measured | 1 of 2: _bound_function | 7 |
test_later_method_still_found | passed | measured | 1 of 2: _bound_function | 7 |
test_nested_class_first_method | passed | measured | 1 of 2: _bound_function | 7 |
test_removed_copy_leaves_remaining_copy_clean | passed | measured | 1 of 2: _bound_function | 7 |
test_second_copy_edited_without_bump_is_flagged_alone | passed | measured | 1 of 2: _bound_function | 7 |
test_the_refusal_survives_known_tags_warn_off | passed | measured | 1 of 2: _bound_function | 7 |
test_unchanged_separate_ifdef_blocks_are_clean | passed | measured | 1 of 2: _bound_function | 7 |
test_utility_is_accepted | passed | measured | 1 of 2: _bound_function | 7 |
test_a_requirement_implemented_by_a_dependency_at_its_pin_is_covered_via_it | passed | measured | 1 of 2: _bound_function | 9 |
test_an_exempt_status_is_listed_not_counted_as_a_gap | passed | measured | 1 of 2: _bound_function | 9 |
test_analyze_coverage_structure | passed | measured | 1 of 2: _bound_function | 9 |
test_coverage_treats_a_declaration_and_its_definition_as_one | passed | measured | 1 of 2: _bound_function | 9 |
test_covering_tests_are_read_from_the_test_tree | passed | measured | 1 of 2: _bound_function | 9 |
test_off_by_default_nothing_changes | passed | measured | 1 of 2: _bound_function | 9 |
test_without_exempt_status_nothing_is_exempt | passed | measured | 1 of 2: _bound_function | 9 |
test_finds_changed_function | passed | measured | 1 of 2: _bound_function | 10 |
test_with_every_gap_exempt_the_gate_passes_and_still_names_them | passed | measured | 1 of 2: _bound_function | 10 |
test_a_range_with_no_files_reads_the_files_the_range_changed | passed | measured | 1 of 2: _bound_function | 11 |
test_full_pipeline | passed | measured | 1 of 2: _bound_function | 11 |
Reached through calls
10 tests: 10 passed
10 passed
| test | result | linked by | implementers exercised | calls away |
|---|---|---|---|---|
test_cfg_test_module_is_not_gated | passed | inferred | 2 of 2: _bound_function, _js_returns_void | 5 |
test_test_functions_are_not_gated | passed | inferred | 2 of 2: _bound_function, _js_returns_void | 5 |
test_binary_named_as_source_is_skipped | passed | inferred | 2 of 2: _bound_function, _js_returns_void | 6 |
test_excluded_file | passed | inferred | 2 of 2: _bound_function, _js_returns_void | 6 |
test_rust_is_opt_in | passed | inferred | 2 of 2: _bound_function, _js_returns_void | 6 |
test_unknown_extension_skipped | passed | inferred | 2 of 2: _bound_function, _js_returns_void | 6 |
test_an_undocumented_declaration_is_not_a_finding | passed | inferred | 2 of 2: _bound_function, _js_returns_void | 7 |
test_unsupported_extension_returns_none | passed | inferred | 2 of 2: _bound_function, _js_returns_void | 7 |
test_a_submodule_in_the_range_is_an_unmapped_file_never_opened | passed | inferred | 2 of 2: _bound_function, _js_returns_void | 9 |
test_no_change_no_result | passed | inferred | 2 of 2: _bound_function, _js_returns_void | 10 |