Skip to content

Refactor VKB test report builders and fix clippy in HID descriptor#298

Open
EffortlessSteven wants to merge 1 commit into
mainfrom
codex/refactor-code-to-be-more-dry-7kx61m
Open

Refactor VKB test report builders and fix clippy in HID descriptor#298
EffortlessSteven wants to merge 1 commit into
mainfrom
codex/refactor-code-to-be-more-dry-7kx61m

Conversation

@EffortlessSteven
Copy link
Copy Markdown
Member

Motivation

  • Remove duplicated byte-packing logic across VKB integration/unit tests by centralizing report builders.
  • Make the test code more DRY and satisfy strict clippy rules for the VKB target.

Description

  • Add shared test helpers in crates/flight-hotas-vkb/tests/common/mod.rs that provide reusable builders like joystick_report, stecs_report, stecs_mt_report, sem_thq_report, t_rudder_report, and with_report_id.
  • Update multiple VKB test modules (crates/flight-hotas-vkb/tests/depth_tests.rs, parse_property_tests.rs, snapshot_tests.rs, and vkb_protocol_depth.rs) to import and use the shared builders instead of local duplicated constructors.
  • Adjust tests that append extra bytes (STECS MT extra-bytes test) to convert the fixed-size report into a Vec only where needed (.to_vec()), preventing misuse of array APIs.
  • Collapse a nested match/if arm in crates/flight-hid-support/src/hid_descriptor.rs (global usage page case) to satisfy clippy::collapsible_match.

Testing

  • Ran rustfmt --check on modified files and it passed.
  • Ran cargo test -p flight-hotas-vkb (unit/proptest/depth/snapshot suites for the crate) and all tests passed.
  • Ran cargo clippy -p flight-hotas-vkb --all-targets -- -D warnings and the linter passed with no warnings.

Codex Task

@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 May 17, 2026

Warning

Rate limit exceeded

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

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ 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: e448718b-7564-4549-9868-c24cbcbe2921

📥 Commits

Reviewing files that changed from the base of the PR and between 7d026c3 and f225cfa.

📒 Files selected for processing (6)
  • crates/flight-hid-support/src/hid_descriptor.rs
  • crates/flight-hotas-vkb/tests/common/mod.rs
  • crates/flight-hotas-vkb/tests/depth_tests.rs
  • crates/flight-hotas-vkb/tests/parse_property_tests.rs
  • crates/flight-hotas-vkb/tests/snapshot_tests.rs
  • crates/flight-hotas-vkb/tests/vkb_protocol_depth.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/refactor-code-to-be-more-dry-7kx61m

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.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant