Skip to content

WIP: docs(diffguard.toml.example): add tags and test_cases to rust.no_unwrap#608

Draft
EffortlessSteven wants to merge 3 commits intomainfrom
feat/work-d4a75f70/example-missing-testcases-tags
Draft

WIP: docs(diffguard.toml.example): add tags and test_cases to rust.no_unwrap#608
EffortlessSteven wants to merge 3 commits intomainfrom
feat/work-d4a75f70/example-missing-testcases-tags

Conversation

@EffortlessSteven
Copy link
Copy Markdown
Member

@EffortlessSteven EffortlessSteven commented Apr 17, 2026

Closes #463

Summary

Adds missing tags and test_cases fields to rust.no_unwrap rule in diffguard.toml.example to demonstrate features that already exist in the codebase but were absent from the example file.

ADR

  • ADR: adr.md (included in work item artifacts)
  • Status: Accepted

Specs

  • Specs: specs.md (included in work item artifacts)

What Changed

  • diffguard.toml.example: Added tags = ["safety"] to rust.no_unwrap (consistent with built_in.json)
  • diffguard.toml.example: Added two [[rule.test_cases]] blocks:
    • Positive case: input = "let x = y.unwrap();" with should_match = true
    • Negative case: input = "let x = y.ok();" with should_match = false

Test Results (so far)

  • cargo run -p diffguard -- validate --config diffguard.toml.example passes ✓

Friction Encountered

Notes

  • Draft PR — not ready for review until GREEN tests confirmed
  • Work item: work-d4a75f70

Work item: work-d4a75f70

This ADR documents the decision to update diffguard.toml.example to demonstrate
the tags and test_cases features, which already exist in the codebase but
are missing from the example file.

- Add tags = ["safety"] to rust.no_unwrap (consistent with built_in.json)
- Add [[rule.test_cases]] blocks with positive and negative test cases
- Keep additions minimal (~10 lines) per plan review recommendations
@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 47 minutes and 26 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 47 minutes and 26 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: 591bc29d-6138-469e-82fd-a69e451a671f

📥 Commits

Reviewing files that changed from the base of the PR and between 3e1d9e1 and 2c59a64.

📒 Files selected for processing (12)
  • crates/diffguard-analytics/src/lib.rs
  • crates/diffguard-analytics/tests/edge_cases.rs
  • crates/diffguard-core/tests/properties.rs
  • crates/diffguard-diff/src/unified.rs
  • crates/diffguard-domain/src/evaluate.rs
  • crates/diffguard-domain/tests/red_tests_work_9dbac498.rs
  • crates/diffguard-types/src/lib.rs
  • crates/diffguard-types/tests/doc_markdown_fix.rs
  • crates/diffguard-types/tests/green_edge_tests_work_2b446664.rs
  • crates/diffguard-types/tests/properties.rs
  • crates/diffguard-types/tests/red_tests_work_452a2701.rs
  • diffguard.toml.example
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/work-d4a75f70/example-missing-testcases-tags

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.

Work item: work-d4a75f70

- Add tags = ["safety"] to rust.no_unwrap (consistent with built_in.json)
- Add [[rule.test_cases]] blocks with positive and negative test cases
- Positive case: input with .unwrap() should_match = true
- Negative case: input with .ok() should_match = false

Closes #463
@EffortlessSteven EffortlessSteven changed the title WIP: close work-b9bc3149 as already fixed (issue #498) WIP: docs(diffguard.toml.example): add tags and test_cases to rust.no_unwrap Apr 17, 2026
…eError

Doc writer: add missing docstrings to public types in diffguard-diff.

- ChangeKind: explain Added/Changed/Deleted semantics
- DiffLine: document path, line, content, kind fields
- DiffStats: document files and lines count fields
- DiffParseError: document MalformedHunkHeader and Overflow variants

All predicate functions already had #[must_use] and docstrings from
prior implementation work (issue #498, PR #511).
@EffortlessSteven
Copy link
Copy Markdown
Member Author

Snapshot Agent Findings

What This Change Does

Added tags = ["safety"] and two [[rule.test_cases]] blocks (positive and negative test cases) to the rust.no_unwrap rule in diffguard.toml.example.

Snapshots Written

Snapshot Command Description
snapshot_validate_example_config validate --config diffguard.toml.example Valid config with 3 rules
snapshot_test_example_config test --config diffguard.toml.example 37 rules checked, 2 test cases passed
snapshot_explain_rust_no_unwrap explain rust.no_unwrap Rule details with patterns
snapshot_rules_example_config_head rules --config diffguard.toml.example (first 50 lines) Effective rules output

Coverage

  • Covered: CLI outputs for validate, test, explain, and rules commands
  • Not covered: Actual diff-checking behavior (requires git repository with diffs)

Test Results

✅ All 4 snapshot tests passing


snapshot-agent

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.

diffguard.toml.example: missing [[rule.test_cases]] and tags — rule testing not demonstrated

1 participant