Skip to content

Conversation

@xdustinface
Copy link
Collaborator

@xdustinface xdustinface commented Dec 28, 2025

honggfuzz doesn't support Windows, causing the pre-commit clippy step in #253 to fail. This excludes dash-fuzz from clippy on Windows only.

Summary by CodeRabbit

Chores

  • Updated pre-commit hook configuration to delegate Rust code linting invocation to a dedicated helper script.
  • New helper script orchestrates Rust linting across the entire workspace with all features enabled. It handles platform-specific target exclusions and enforces a warnings-as-errors policy for stricter code quality validation during the development cycle.

✏️ Tip: You can customize this high-level summary in your review settings.

`honggfuzz` doesn't support Windows, causing the `pre-commit` clippy step in #253 to fail. This excludes `dash-fuzz` from clippy on Windows only.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 28, 2025

📝 Walkthrough

Walkthrough

The clippy pre-commit hook was refactored from a direct cargo invocation to use a Python wrapper script. The new script orchestrates cargo clippy with feature flags, handles platform-specific exclusions for dash-fuzz on Windows, and enforces warnings-as-errors linting.

Changes

Cohort / File(s) Summary
Clippy Linting Refactor
.pre-commit-config.yaml, contrib/run_clippy.py
Replaced inline cargo clippy command in pre-commit hook with invocation of new Python wrapper script (contrib/run_clippy.py) that centralizes clippy orchestration logic, including workspace-wide scanning, feature flags, platform-specific target exclusions, and lint-as-error enforcement.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A clippy script, neat and new,
One hop from config, straight and true,
No more flags scattered 'round,
Just Python logic, safety-bound! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: excluding dash-fuzz from clippy on Windows, which is the core issue being fixed to resolve Windows compatibility problems.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ci/pre-commit-windows

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
contrib/run_clippy.py (1)

1-20: LGTM! Clean implementation of the platform-specific exclusion.

The script correctly orchestrates cargo clippy with the required flags and conditionally excludes dash-fuzz on Windows. The command construction matches the workspace linting requirements from learnings.

Regarding the static analysis hint (S603): this is a false positive. All command arguments are hardcoded strings, and sys.platform is a trusted system property, not user input.

Optional: Consider subprocess.run() for modern Python

While subprocess.call() works correctly, subprocess.run() is the recommended API in Python 3.5+:

-sys.exit(subprocess.call(cmd))
+sys.exit(subprocess.run(cmd).returncode)

This is purely stylistic and not necessary.

Based on learnings, this approach ensures clippy runs with -D warnings to avoid warnings in CI.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3884314 and 3e2515b.

📒 Files selected for processing (2)
  • .pre-commit-config.yaml
  • contrib/run_clippy.py
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-22T17:59:51.097Z
Learning: Applies to **/*.rs : Run `cargo clippy --workspace --all-targets -- -D warnings` for linting; avoid warnings in CI
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-22T17:59:37.849Z
Learning: Applies to **/*.rs : Pass clippy linting without warnings
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-22T17:59:51.097Z
Learning: Run pre-PR checks: `cargo fmt`, `cargo clippy`, `cargo test` (workspace) before submitting pull requests
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2025-12-16T09:03:55.811Z
Learning: Run 'cargo fmt --check' to verify formatting, 'cargo clippy --all-targets --all-features -- -D warnings' for linting, and 'cargo check --all-features' to verify all features compile
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-22T17:59:51.097Z
Learning: Applies to **/*.rs : Format code with `rustfmt` before commits; ensure `cargo fmt --all` is run
📚 Learning: 2025-12-22T17:59:51.097Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-22T17:59:51.097Z
Learning: Applies to **/*.rs : Run `cargo clippy --workspace --all-targets -- -D warnings` for linting; avoid warnings in CI

Applied to files:

  • contrib/run_clippy.py
  • .pre-commit-config.yaml
📚 Learning: 2025-12-22T17:59:37.849Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-22T17:59:37.849Z
Learning: Applies to **/*.rs : Pass clippy linting without warnings

Applied to files:

  • contrib/run_clippy.py
  • .pre-commit-config.yaml
📚 Learning: 2025-12-16T09:03:55.811Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2025-12-16T09:03:55.811Z
Learning: Run 'cargo fmt --check' to verify formatting, 'cargo clippy --all-targets --all-features -- -D warnings' for linting, and 'cargo check --all-features' to verify all features compile

Applied to files:

  • contrib/run_clippy.py
📚 Learning: 2025-12-22T17:59:51.097Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-22T17:59:51.097Z
Learning: Run pre-PR checks: `cargo fmt`, `cargo clippy`, `cargo test` (workspace) before submitting pull requests

Applied to files:

  • contrib/run_clippy.py
  • .pre-commit-config.yaml
🪛 Ruff (0.14.10)
contrib/run_clippy.py

20-20: subprocess call: check for execution of untrusted input

(S603)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
  • GitHub Check: Core Components Tests
  • GitHub Check: SPV Components Tests
  • GitHub Check: RPC Tests (stable, true)
  • GitHub Check: fuzz (hashes_sha512)
  • GitHub Check: fuzz (hashes_ripemd160)
  • GitHub Check: fuzz (dash_deserialize_script)
  • GitHub Check: fuzz (hashes_sha256)
  • GitHub Check: fuzz (hashes_json)
  • GitHub Check: fuzz (dash_deserialize_block)
  • GitHub Check: fuzz (hashes_sha512_256)
  • GitHub Check: fuzz (hashes_sha1)
  • GitHub Check: fuzz (dash_script_bytes_to_asm_fmt)
  • GitHub Check: fuzz (hashes_cbor)
  • GitHub Check: fuzz (dash_outpoint_string)
  • GitHub Check: fuzz (dash_deser_net_msg)
  • GitHub Check: fuzz (dash_deserialize_amount)
  • GitHub Check: fuzz (dash_deserialize_address)
  • GitHub Check: fuzz (dash_deserialize_witness)
  • GitHub Check: Pre-commit (macos-latest)
  • GitHub Check: Pre-commit (ubuntu-latest)
🔇 Additional comments (1)
.pre-commit-config.yaml (1)

83-83: LGTM! Proper delegation to the Python wrapper.

The change correctly delegates clippy execution to the new contrib/run_clippy.py script, which handles the platform-specific exclusion logic while preserving the same clippy flags and behavior on non-Windows platforms.

Based on learnings, this maintains the requirement to run cargo clippy --workspace --all-targets -- -D warnings for linting.

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.

2 participants