chore: sync from monorepo @0fd44c3#24
Conversation
📝 WalkthroughWalkthroughThis pull request systematically removes Git ignore rules, vulnerability suppression configurations, and Clippy lint suppressions across the codebase while refactoring validation logic to use explicit comparisons instead of range methods and standardizing code formatting. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Review rate limit: 0/1 reviews remaining, refill in 60 minutes.Comment |
There was a problem hiding this comment.
Code Review
This pull request performs a broad cleanup of the codebase, including the removal of several configuration files and the downgrading of specific dependencies like rand and rustls-webpki. Significant changes involve removing numerous lint suppressions, simplifying macro usage, and refactoring range validation logic from iterator-based checks to explicit comparisons. Feedback recommends consolidating the repeated coordinate validation logic into a shared utility function to enhance maintainability and adhere to DRY principles.
| // Coordinate range validation (mirrors record_delivery). | ||
| require!( | ||
| (-900_000_000..=900_000_000).contains(&lat), | ||
| lat >= -900_000_000 && lat <= 900_000_000, |
| ); | ||
| require!( | ||
| (-900_000_000..=900_000_000).contains(&lat), | ||
| lat >= -900_000_000 && lat <= 900_000_000, |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@resq-airspace/src/lib.rs`:
- Line 1: Remove the crate-level allow(unexpected_cfgs) and instead apply a
targeted allow for the high-arity Anchor instruction handler: add
#[allow(clippy::too_many_arguments)] to the initialize_property function (the
Anchor instruction handler with 9 parameters) so clippy won't fail the CI while
keeping other lints enabled; keep or re-add unexpected_cfgs only where truly
needed, not at crate level.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 5bb83b2e-122c-44e2-ba7c-e8b9e9f0ab05
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (22)
.gitignoreosv-scanner.tomlresq-airspace/src/error.rsresq-airspace/src/instructions/grant_permit.rsresq-airspace/src/instructions/initialize_property.rsresq-airspace/src/instructions/record_crossing.rsresq-airspace/src/instructions/update_policy.rsresq-airspace/src/instructions/update_treasury.rsresq-airspace/src/lib.rsresq-airspace/src/state/airspace_account.rsresq-airspace/src/state/mod.rsresq-airspace/src/state/permit.rsresq-airspace/tests/host_init_regression.rsresq-airspace/tests/integration.rsresq-delivery/src/error.rsresq-delivery/src/instructions/mod.rsresq-delivery/src/instructions/record_delivery.rsresq-delivery/src/lib.rsresq-delivery/src/state/delivery_record.rsresq-delivery/src/state/mod.rsresq-delivery/tests/integration.rsvendor/solana-program-test/osv-scanner.toml
💤 Files with no reviewable changes (3)
- .gitignore
- vendor/solana-program-test/osv-scanner.toml
- osv-scanner.toml
| clippy::too_many_arguments, | ||
| clippy::diverging_sub_expression | ||
| )] | ||
| #![allow(unexpected_cfgs)] |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
python - <<'PY'
import re
from pathlib import Path
files = [
Path("resq-airspace/src/lib.rs"),
Path("resq-airspace/src/instructions/initialize_property.rs"),
]
pattern = re.compile(r'pub fn\s+(\w+)\s*\((.*?)\)\s*->', re.S)
for file in files:
text = file.read_text()
print(f"\n== {file} ==")
for name, args in pattern.findall(text):
args = re.sub(r'//.*', '', args)
params = [p.strip() for p in args.split(',') if p.strip()]
if len(params) > 7:
print(f"{name}: {len(params)} parameters (likely clippy::too_many_arguments)")
PYRepository: resq-software/programs
Length of output: 287
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Check git history to see what the previous allow statement was
echo "=== Previous version of resq-airspace/src/lib.rs line 1 ==="
git show HEAD~1:resq-airspace/src/lib.rs 2>/dev/null | head -5 || echo "Cannot retrieve previous version"
echo -e "\n=== Current version of resq-airspace/src/lib.rs line 1-5 ==="
head -5 resq-airspace/src/lib.rs
echo -e "\n=== Running cargo clippy --workspace -- -D warnings ==="
cd resq-airspace && cargo clippy --workspace -- -D warnings 2>&1 | head -100 || trueRepository: resq-software/programs
Length of output: 582
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Let's also check the exact signatures of the high-arity functions
echo "=== Checking initialize_property signature ==="
rg -A 15 "pub fn initialize_property" resq-airspace/src/lib.rs
echo -e "\n=== Checking handler signature in instructions ==="
rg -A 15 "pub fn handler" resq-airspace/src/instructions/initialize_property.rs 2>/dev/null || echo "File not found, checking lib.rs"Repository: resq-software/programs
Length of output: 1126
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Check if there are other similar high-arity functions in the codebase
echo "=== Checking all pub fn declarations with parameter counts ==="
rg -A 10 "pub fn" resq-airspace/src/ | grep -E "(pub fn|->)" | head -50
# Check if there are other clippy allow directives in the workspace
echo -e "\n=== Checking for clippy allow directives ==="
rg "clippy::" resq-airspace/src/ || echo "No clippy allows found"
# Check the resq-delivery program for comparison
echo -e "\n=== Checking resq-delivery lib.rs for comparison ==="
head -5 resq-delivery/src/lib.rs 2>/dev/null || echo "File not found"Repository: resq-software/programs
Length of output: 2018
🏁 Script executed:
#!/bin/bash
set -euo clipfail
# Let's check Cargo.toml to understand the Anchor version and defaults
echo "=== resq-airspace Cargo.toml ==="
head -20 resq-airspace/Cargo.toml
echo -e "\n=== Checking if instruction handlers across codebase follow high-arity pattern ==="
rg "pub fn\s+handler\(" resq-airspace/src/instructions/ -A 1 | head -50Repository: resq-software/programs
Length of output: 120
Remove crate-level allow(unexpected_cfgs) to prevent clippy CI failures on high-arity instructions.
With cargo clippy --workspace -- -D warnings, the initialize_property function (9 parameters) will trigger clippy::too_many_arguments. The current allow statement only covers unexpected_cfgs; restore protection for Anchor instruction handlers with >7 parameters.
-#![allow(unexpected_cfgs)]
+#![allow(unexpected_cfgs, clippy::too_many_arguments)]As per coding guidelines: Run cargo clippy --workspace -- -D warnings to catch lints and treat warnings as errors.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| #![allow(unexpected_cfgs)] | |
| #![allow(unexpected_cfgs, clippy::too_many_arguments)] |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@resq-airspace/src/lib.rs` at line 1, Remove the crate-level
allow(unexpected_cfgs) and instead apply a targeted allow for the high-arity
Anchor instruction handler: add #[allow(clippy::too_many_arguments)] to the
initialize_property function (the Anchor instruction handler with 9 parameters)
so clippy won't fail the CI while keeping other lints enabled; keep or re-add
unexpected_cfgs only where truly needed, not at crate level.
Automated sync from resq-software/resQ@
0fd44c3.Review before merging — direct pushes to standalone repos are preserved.
Summary by CodeRabbit
Chores
.gitignoreto track previously ignored build artifacts and dependencies.Style
AccessPolicyto use explicit default implementation instead of derive.