Skip to content

WIP: Add # Panics documentation to ConfigFile::built_in()#606

Draft
EffortlessSteven wants to merge 1 commit intomainfrom
feat/work-2b446664/configfile-built-in-panics-doc
Draft

WIP: Add # Panics documentation to ConfigFile::built_in()#606
EffortlessSteven wants to merge 1 commit intomainfrom
feat/work-2b446664/configfile-built-in-panics-doc

Conversation

@EffortlessSteven
Copy link
Copy Markdown
Member

Closes #493

Summary

Adds missing # Panics documentation to ConfigFile::built_in() to satisfy clippy::missing_panics_doc. The function panics if built_in.json cannot be parsed as valid JSON.

What Changed

  • crates/diffguard-types/src/lib.rs: Added # Panics section to ConfigFile::built_in() documenting that it panics if built_in.json cannot be parsed.

Test Results (so far)

clippy passes with no warnings.

Friction Encountered

Notes

  • Draft PR — not ready for review until GREEN tests confirmed

Satisfies clippy::missing_panics_doc by documenting that the function
panics if built_in.json cannot be parsed as valid JSON.
@gemini-code-assist
Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 17, 2026

Warning

Rate limit exceeded

@EffortlessSteven has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 14 minutes and 13 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 14 minutes and 13 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 8fa8331c-e67c-41cb-a5dd-675a0a23b8bd

📥 Commits

Reviewing files that changed from the base of the PR and between 3e1d9e1 and 21d54b5.

📒 Files selected for processing (1)
  • crates/diffguard-types/src/lib.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/work-2b446664/configfile-built-in-panics-doc

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@EffortlessSteven
Copy link
Copy Markdown
Member Author

Doc Writer Review

Status: ✓ Complete

Verified the documentation is correctly added to :

/// # Panics
///
/// Panics if `built_in.json` cannot be parsed as valid JSON.

Verification

  • — 0 warnings

running 4 tests
test tests::defaults_match_expected_values ... ok
test tests::severity_scope_failon_as_str ... ok
test tests::verdict_counts_suppressed_is_omitted_when_zero ... ok
test tests::built_in_config_contains_expected_rules_and_unique_ids ... ok

test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s

running 11 tests
test built_in_rules_have_at_least_one_pattern ... ok
test built_in_all_rule_ids_are_unique ... ok
test built_in_has_exactly_36_rules ... ok
test built_in_contains_expected_rules ... ok
test built_in_rules_have_non_empty_id ... ok
test built_in_includes_are_empty ... ok
test built_in_defaults_are_default ... ok
test built_in_rules_have_valid_severity ... ok
test built_in_rules_are_valid_rule_config_objects ... ok
test built_in_config_serializes_to_valid_json ... ok
test built_in_rules_have_valid_regex_patterns ... ok

test result: ok. 11 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.26s

running 2 tests
test test_verdict_counts_suppressed_is_zero ... ok
test test_match_mode_is_match_mode_any ... ok

test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

running 10 tests
test built_in_result_is_send_and_sync ... ok
test must_use_count_remains_four ... ok
test built_in_result_can_be_cloned ... ok
test built_in_defaults_are_standard ... ok
test must_use_attribute_consistency ... ok
test built_in_rules_have_valid_ids_and_severities ... ok
test built_in_round_trip_serialization ... ok
test built_in_partial_use_is_valid ... ok
test built_in_includes_are_empty ... ok
test built_in_idempotent_multiple_calls_identical ... ok

test result: ok. 10 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.03s

running 18 tests
test test_is_false_accepts_bool_by_value ... ok
test test_is_false_with_true_serializes ... ok
test test_is_false_with_true_value ... ok
test test_all_predicates_combined_edge_cases ... ok
test test_is_match_mode_any_with_absent_serializes ... ok
test test_is_match_mode_any_with_any_variant ... ok
test test_is_zero_accepts_u32_by_value ... ok
test test_is_zero_boundary_values ... ok
test test_is_match_mode_any_accepts_match_mode_by_value ... ok
test test_is_match_mode_any_with_absent_variant ... ok
test test_is_false_with_false_value ... ok
test test_is_zero_u32_max ... ok
test test_is_zero_does_not_affect_other_u32_fields ... ok
test test_is_zero_u32_min ... ok
test test_is_zero_with_nonzero_serializes ... ok
test test_skip_serializing_if_combined_default_values ... ok
test test_round_trip_with_edge_case_values ... ok
test test_skip_serializing_if_round_trip ... ok

test result: ok. 18 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

running 37 tests
test unit_tests::check_receipt_json_round_trip ... ok
test unit_tests::config_file_json_round_trip ... ok
test fail_on_json_round_trip ... ok
test unit_tests::fail_on_as_str_matches_expected ... ok
test scope_json_round_trip ... ok
test severity_json_round_trip ... ok
test unit_tests::empty_config_validates_against_schema ... ok
test unit_tests::check_receipt_with_findings_validates_against_schema ... ok
test unit_tests::invalid_scope_rejected_by_config_schema ... ok
test unit_tests::is_snake_case_accepts_valid_snake_case ... ok
test unit_tests::finding_without_column_validates ... ok
test unit_tests::invalid_fail_on_rejected_by_config_schema ... ok
test unit_tests::config_with_all_optional_fields_null ... ok
test unit_tests::empty_strings_validate ... ok
test unit_tests::is_snake_case_rejects_camel_case ... ok
test unit_tests::is_snake_case_rejects_invalid_formats ... ok
test unit_tests::scope_as_str_matches_expected ... ok
test unit_tests::severity_as_str_matches_expected ... ok
test unit_tests::invalid_severity_rejected_by_schema ... ok
test unit_tests::verdict_counts_suppressed_serializes_when_nonzero ... ok
test unit_tests::verdict_counts_suppressed_skips_zero ... ok
test unit_tests::minimal_check_receipt_validates_against_schema ... ok
test unit_tests::max_u32_values_validate ... ok
test unit_tests::missing_required_field_rejected_by_schema ... ok
test defaults_field_names_are_snake_case ... ok
test unit_tests::rule_missing_patterns_rejected_by_config_schema ... ok
test unit_tests::unicode_content_validates ... ok
test unit_tests::built_in_config_validates_against_schema ... ok
test verdict_status_json_round_trip ... ok
test finding_field_names_are_snake_case ... ok
test verdict_field_names_are_snake_case ... ok
test rule_config_field_names_are_snake_case ... ok
test config_file_field_names_are_snake_case ... ok
test check_receipt_field_names_are_snake_case ... ok
test config_file_toml_round_trip ... ok
test config_file_validates_against_schema ... ok
test check_receipt_validates_against_schema ... ok

test result: ok. 37 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.68s

running 3 tests
test must_use_attribute_count_is_four ... ok
test config_file_built_in_has_must_use_attribute ... ok
test built_in_returns_config_with_36_rules ... ok

test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s — 37 passed, 0 failed

  • — passes
  • — passes
  • — passes

Assessment

Documentation is complete. The fix is minimal and targeted — adding just the section to one method. All public items in are well-documented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ConfigFile::built_in() panics but is missing # Panics documentation — clippy::missing_panics_doc

1 participant