REQ-DDB-GUARD-014: Typed errors at the library boundary

← Requirements

What it requires

  1. load_config raises ConfigError rather than calling sys.exit, so a caller guarding with except Exception handles it; the CLI catches GuardError and returns exit 1
tier
PASS
declared
implemented
priority
P1

Where it lives

  • Guard: the pre-commit gate5

See it on the map

How it is met

implemented byresults (121 tests)__init____str__detailsparse_versionresolve_version_gate121 passed121 tests, a summary by result: every test is in the tests table below

Show on the map

Implemented by

Tests (121)

Linked directly

72 tests: 72 passed

72 passed
testresultlinked byimplementers exercisedcalls away
test_a_symlinked_impact_directory_is_refusedpassedmeasured3 of 5: __init__, details, resolve_version_gate—
test_absolute_path_rejectedpassedmeasured3 of 5: __init__, __str__, details—
test_csv_missing_id_column_names_the_problempassedmeasured3 of 5: __init__, __str__, details—
test_declared_without_file_raisespassedmeasured3 of 5: __init__, __str__, details—
test_id_failing_configured_pattern_raisespassedmeasured3 of 5: __init__, __str__, details—
test_json_object_instead_of_list_raisespassedmeasured3 of 5: __init__, __str__, details—
test_malformed_json_raises_requirements_errorpassedmeasured3 of 5: __init__, __str__, details—
test_mid_path_traversal_rejectedpassedmeasured3 of 5: __init__, __str__, details—
test_missing_file_raisespassedmeasured3 of 5: __init__, __str__, details—
test_missing_name_field_raisespassedmeasured3 of 5: __init__, __str__, details—
test_out_of_tree_catalog_rejectedpassedmeasured3 of 5: __init__, __str__, details—
test_precommit_fails_when_gate_unresolvablepassedmeasured3 of 5: __init__, details, resolve_version_gate—
test_traversal_catalog_rejectedpassedmeasured3 of 5: __init__, __str__, details—
test_traversal_rejectedpassedmeasured3 of 5: __init__, __str__, details—
test_unknown_format_raisespassedmeasured3 of 5: __init__, __str__, details—
test_validate_fails_when_gate_unresolvablepassedmeasured3 of 5: __init__, details, resolve_version_gate—
test_wrong_yaml_shape_raisespassedmeasured3 of 5: __init__, __str__, details—
test_a_doxygen_guard_hook_id_fails_naming_itpassedmeasured2 of 5: __init__, details—
test_a_floor_outside_zero_to_one_is_refusedpassedmeasured2 of 5: __init__, details—
test_a_leftover_doxygen_guard_yaml_fails_naming_itpassedmeasured2 of 5: __init__, details—
test_a_legacy_config_with_no_guard_section_is_refusedpassedmeasured2 of 5: __init__, details—
test_literal_version_resolvespassedmeasured2 of 5: parse_version, resolve_version_gate—
test_no_gate_declared_is_not_an_errorpassedmeasured2 of 5: __init__, details—
test_a_1x_regex_exclude_is_refused_with_a_pointerpassedmeasured1 of 5: __init__—
test_a_catalogue_not_marked_parent_still_refusespassedmeasured1 of 5: __init__—
test_a_checked_tree_says_nothing_extrapassedmeasured1 of 5: resolve_version_gate—
test_a_clean_repo_passespassedmeasured1 of 5: resolve_version_gate—
test_a_configured_language_is_not_reportedpassedmeasured1 of 5: resolve_version_gate—
test_a_guard_section_that_is_not_a_mapping_is_refused_by_the_gatepassedmeasured1 of 5: __init__—
test_a_migrated_repo_with_the_leftover_is_refused_toopassedmeasured1 of 5: __init__—
test_a_namespaced_satisfies_id_resolves_by_its_bare_idpassedmeasured1 of 5: resolve_version_gate—
test_a_non_source_file_stays_silentpassedmeasured1 of 5: resolve_version_gate—
test_a_non_void_return_type_on_its_own_line_still_needs_onepassedmeasured1 of 5: resolve_version_gate—
test_a_pinned_external_catalogue_is_read_at_its_revisionpassedmeasured1 of 5: resolve_version_gate—
test_a_tag_with_no_catalogue_to_check_it_is_reportedpassedmeasured1 of 5: resolve_version_gate—
test_a_void_return_type_on_its_own_line_needs_no_return_tagpassedmeasured1 of 5: resolve_version_gate—
test_an_excluded_file_is_counted_as_not_checkedpassedmeasured1 of 5: resolve_version_gate—
test_an_external_catalogue_satisfies_cross_reference_without_a_local_onepassedmeasured1 of 5: resolve_version_gate—
test_an_invalid_guard_section_is_survivedpassedmeasured1 of 5: __init__—
test_an_invalid_section_degrades_the_index_and_is_refused_by_the_gatepassedmeasured1 of 5: __init__—
test_an_old_location_is_refused_with_a_pointerpassedmeasured1 of 5: __init__—
test_an_opt_in_language_left_unconfigured_is_namedpassedmeasured1 of 5: resolve_version_gate—
test_an_unchecked_file_is_named_without_the_verbose_flagpassedmeasured1 of 5: resolve_version_gate—
test_an_unknown_requirements_key_is_refusedpassedmeasured1 of 5: __init__—
test_bus_tags_moved_to_the_declarationpassedmeasured1 of 5: __init__—
test_config_error_is_caught_by_except_exceptionpassedmeasured1 of 5: __init__—
test_custom_configpassedmeasured1 of 5: resolve_version_gate—
test_default_subcommand_with_filespassedmeasured1 of 5: resolve_version_gate—
test_precommit_mode_flags_a_stale_rust_functionpassedmeasured1 of 5: resolve_version_gate—
test_precommit_with_impactpassedmeasured1 of 5: resolve_version_gate—
test_the_gate_refuses_a_satisfies_id_no_catalogue_holdspassedmeasured1 of 5: resolve_version_gate—
test_the_pre_commit_hook_runs_the_coverage_gatepassedmeasured1 of 5: resolve_version_gate—
test_unknown_key_raises_config_errorpassedmeasured1 of 5: __init__—
test_unreadable_yaml_raises_config_errorpassedmeasured1 of 5: __init__—
test_validate_clean_filepassedmeasured1 of 5: resolve_version_gate—
test_validate_dirty_filepassedmeasured1 of 5: resolve_version_gate—
test_validate_nonexistent_filepassedmeasured1 of 5: resolve_version_gate—
test_validate_writes_the_format_to_stdout_and_keeps_the_exit_codepassedmeasured1 of 5: resolve_version_gate—
test_verbose_flagpassedmeasured1 of 5: resolve_version_gate—
test_invalid_raisespassedmeasured4 of 5: __init__, __str__, details, parse_version1
test_basicpassedmeasured1 of 5: parse_version1
test_build_metadatapassedmeasured1 of 5: parse_version1
test_no_prefixpassedmeasured1 of 5: parse_version1
test_prerelease_versionpassedmeasured1 of 5: parse_version1
test_single_partpassedmeasured1 of 5: parse_version1
test_two_partspassedmeasured1 of 5: parse_version1
test_typoed_version_field_raisespassedmeasured3 of 5: __init__, __str__, details2
test_all_rows_declaring_the_field_filters_normallypassedmeasured1 of 5: parse_version2
test_current_reqs_keptpassedmeasured1 of 5: parse_version2
test_equal_version_keptpassedmeasured1 of 5: parse_version2
test_future_reqs_filteredpassedmeasured1 of 5: parse_version2
test_row_missing_the_field_raisespassedmeasured1 of 5: __init__2
Reached through calls

49 tests: 49 passed

49 passed
testresultlinked byimplementers exercisedcalls away
test_no_version_gate_returns_allpassedinferred1 of 5: parse_version2
test_constructor_skipped_for_req_checkpassedinferred1 of 5: parse_version4
test_coverage_message_lists_the_real_exemption_tagspassedinferred1 of 5: parse_version4
test_regular_function_still_requires_reqpassedinferred1 of 5: parse_version4
test_a_broken_toolchain_file_is_reported_not_fatalpassedinferred1 of 5: parse_version5
test_all_checks_runpassedinferred1 of 5: parse_version5
test_binary_named_as_source_is_skippedpassedinferred1 of 5: parse_version5
test_clew_specific_ignores_apply_to_the_gatepassedinferred1 of 5: parse_version5
test_decorative_triggers_presence_violationpassedinferred1 of 5: parse_version5
test_docstring_satisfies_req_tagpassedinferred1 of 5: parse_version5
test_docstring_tags_satisfy_presencepassedinferred1 of 5: parse_version5
test_documented_file_no_violationspassedinferred1 of 5: parse_version5
test_excluded_filepassedinferred1 of 5: parse_version5
test_excluded_path_is_absent_and_gate_skips_itpassedinferred1 of 5: parse_version5
test_fixture_violationspassedinferred1 of 5: parse_version5
test_fully_documented_pythonpassedinferred1 of 5: parse_version5
test_inner_doc_satisfies_the_file_block_without_at_filepassedinferred1 of 5: parse_version5
test_javascript_extensionspassedinferred1 of 5: parse_version5
test_missing_file_block_suggests_inner_docpassedinferred1 of 5: parse_version5
test_nested_lookalike_path_agreespassedinferred1 of 5: parse_version5
test_no_false_positivespassedinferred1 of 5: parse_version5
test_no_false_positives_with_attributespassedinferred1 of 5: parse_version5
test_only_definitions_checkedpassedinferred1 of 5: parse_version5
test_opt_inpassedinferred1 of 5: parse_version5
test_presence_message_c_style_for_c_filepassedinferred1 of 5: parse_version5
test_presence_message_includes_return_for_non_voidpassedinferred1 of 5: parse_version5
test_presence_message_omits_return_for_voidpassedinferred1 of 5: parse_version5
test_presence_message_python_stylepassedinferred1 of 5: parse_version5
test_require_return_bites_only_on_valued_annotationspassedinferred1 of 5: parse_version5
test_return_is_not_required_for_rustpassedinferred1 of 5: parse_version5
test_return_requirement_can_be_turned_back_onpassedinferred1 of 5: parse_version5
test_rust_is_opt_inpassedinferred1 of 5: parse_version5
test_toolchain_ignore_paths_skip_validationpassedinferred1 of 5: parse_version5
test_tsx_file_uses_typescript_configpassedinferred1 of 5: parse_version5
test_unknown_extension_skippedpassedinferred1 of 5: parse_version5
test_validate_file_pythonpassedinferred1 of 5: parse_version5
test_violationspassedinferred1 of 5: parse_version5
test_without_toolchain_files_everything_is_checkedpassedinferred1 of 5: parse_version5
test_a_cpp_member_declaration_is_checked_toopassedinferred1 of 5: parse_version6
test_a_dead_req_on_a_documented_declaration_is_refusedpassedinferred1 of 5: parse_version6
test_a_declaration_does_not_need_its_own_reqpassedinferred1 of 5: parse_version6
test_a_documented_declaration_needs_its_versionpassedinferred1 of 5: parse_version6
test_an_undocumented_declaration_is_not_a_findingpassedinferred1 of 5: parse_version6
test_class_level_block_does_not_leak_to_first_methodpassedinferred1 of 5: parse_version6
test_excludes_are_globs_and_a_regex_says_sopassedinferred1 of 5: parse_version6
test_first_method_after_class_docstring_still_foundpassedinferred1 of 5: parse_version6
test_first_method_directly_after_class_linepassedinferred1 of 5: parse_version6
test_later_method_still_foundpassedinferred1 of 5: parse_version6
test_nested_class_first_methodpassedinferred1 of 5: parse_version6

Flows through it