Update documentation and modify core#86
Conversation
|
Warning Review limit reached
More reviews will be available in 50 minutes and 16 seconds. Learn how PR review limits work. To continue reviewing without waiting, enable usage-based billing in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughREADME and CLI text were updated for multi-ecosystem scanning. Core scanner logic now detects Rust, Node, and Java artifact directories, analyzer output is sorted and filesystem traversal uses ChangesArtifact workflow updates
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/dustfril-cli/src/shared/path.rs (1)
3-11: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winOnly accept directories as scan roots.
scan::executepasses this straight intoapi::scanas the project root, so an existing file currently validates here and then falls through to a misleading “No artifacts found.” path. Tightening this tois_dir()also lets the caller own the final error message instead of splitting stderr output across two layers.Proposed fix
-/// Returns `true` when the given path exists on disk. +/// Returns `true` when the given path is an existing directory. pub fn validate_path(path: &Path) -> bool { - if !path.exists() { - eprintln!("Path does not exist: {}", path.display()); - + if !path.exists() || !path.is_dir() { return false; } true }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/dustfril-cli/src/shared/path.rs` around lines 3 - 11, The validate_path function currently accepts any existing path, including files, which lets scan::execute pass a non-directory into api::scan and produce a misleading outcome. Update validate_path to only return true for directories by checking the Path with is_dir() instead of exists(), and remove the direct stderr printing so the caller can handle the final error message in one place.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/dustfril-core/src/scanner/detector.rs`:
- Around line 77-93: The Java detector currently treats Maven and Gradle the
same by always matching and returning build/, which misses standard Maven
projects. Update detector.rs so Detector::matches and Detector::artifacts
distinguish pom.xml from build.gradle/build.gradle.kts: Maven should look for
target/ and return a Maven artifact from target/, while Gradle should continue
using build/; keep the existing Java ecosystem type and ensure the helper/test
cases cover pom.xml with target/ separately from Gradle layouts.
---
Outside diff comments:
In `@apps/dustfril-cli/src/shared/path.rs`:
- Around line 3-11: The validate_path function currently accepts any existing
path, including files, which lets scan::execute pass a non-directory into
api::scan and produce a misleading outcome. Update validate_path to only return
true for directories by checking the Path with is_dir() instead of exists(), and
remove the direct stderr printing so the caller can handle the final error
message in one place.
🪄 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 Plus
Run ID: 79aef025-0102-4255-9723-128eaabba1ae
📒 Files selected for processing (19)
README.ko.mdREADME.mdapps/dustfril-cli/src/cli.rsapps/dustfril-cli/src/commands/scan.rsapps/dustfril-cli/src/format/size_format.rsapps/dustfril-cli/src/format/time_format.rsapps/dustfril-cli/src/shared/path.rscrates/dustfril-core/src/analyzer/analyze.rscrates/dustfril-core/src/api/analyze.rscrates/dustfril-core/src/api/clean.rscrates/dustfril-core/src/api/scan.rscrates/dustfril-core/src/cleaner/executor.rscrates/dustfril-core/src/cleaner/plan.rscrates/dustfril-core/src/fs/walk.rscrates/dustfril-core/src/models/cleanup.rscrates/dustfril-core/src/models/scan.rscrates/dustfril-core/src/scanner/detector.rscrates/dustfril-core/src/scanner/scan.rscrates/dustfril-core/src/scanner/tests.rs
| fn matches(&self, root: &Path) -> bool { | ||
| (root.join("pom.xml").is_file() | ||
| || root.join("build.gradle").is_file() | ||
| || root.join("build.gradle.kts").is_file() | ||
| || root.join("build.gradle.kts").is_file()) | ||
| && root.join("build").is_dir() | ||
| } | ||
|
|
||
| fn artifacts(&self, root: &Path) -> Vec<Artifact> { | ||
| let mut artifacts = Vec::new(); | ||
| let build = root.join("build"); | ||
|
|
||
| if build.is_dir() | ||
| && (root.join("pom.xml").is_file() | ||
| || root.join("build.gradle").is_file() | ||
| || root.join("build.gradle.kts").is_file()) | ||
| { | ||
| artifacts.push(Artifact::new(build, Ecosystem::Java)); |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Handle Maven artifacts separately from Gradle artifacts.
pom.xml identifies Maven, but this detector only matches and returns build/. Standard Maven outputs live under target/, so Java scans will miss normal Maven projects entirely. The new Java test helper also creates pom.xml + build/, so this regression stays untested.
💡 Proposed fix
impl Detector for JavaDetector {
fn matches(&self, root: &Path) -> bool {
- (root.join("pom.xml").is_file()
- || root.join("build.gradle").is_file()
- || root.join("build.gradle.kts").is_file())
- && root.join("build").is_dir()
+ (root.join("pom.xml").is_file() && root.join("target").is_dir())
+ || ((root.join("build.gradle").is_file()
+ || root.join("build.gradle.kts").is_file())
+ && root.join("build").is_dir())
}
fn artifacts(&self, root: &Path) -> Vec<Artifact> {
let mut artifacts = Vec::new();
- let build = root.join("build");
-
- if build.is_dir()
- && (root.join("pom.xml").is_file()
- || root.join("build.gradle").is_file()
- || root.join("build.gradle.kts").is_file())
- {
- artifacts.push(Artifact::new(build, Ecosystem::Java));
+ if root.join("pom.xml").is_file() {
+ let target = root.join("target");
+ if target.is_dir() {
+ artifacts.push(Artifact::new(target, Ecosystem::Java));
+ }
+ }
+
+ if root.join("build.gradle").is_file() || root.join("build.gradle.kts").is_file() {
+ let build = root.join("build");
+ if build.is_dir() {
+ artifacts.push(Artifact::new(build, Ecosystem::Java));
+ }
}
artifacts
}📝 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.
| fn matches(&self, root: &Path) -> bool { | |
| (root.join("pom.xml").is_file() | |
| || root.join("build.gradle").is_file() | |
| || root.join("build.gradle.kts").is_file() | |
| || root.join("build.gradle.kts").is_file()) | |
| && root.join("build").is_dir() | |
| } | |
| fn artifacts(&self, root: &Path) -> Vec<Artifact> { | |
| let mut artifacts = Vec::new(); | |
| let build = root.join("build"); | |
| if build.is_dir() | |
| && (root.join("pom.xml").is_file() | |
| || root.join("build.gradle").is_file() | |
| || root.join("build.gradle.kts").is_file()) | |
| { | |
| artifacts.push(Artifact::new(build, Ecosystem::Java)); | |
| fn matches(&self, root: &Path) -> bool { | |
| (root.join("pom.xml").is_file() && root.join("target").is_dir()) | |
| || ((root.join("build.gradle").is_file() | |
| || root.join("build.gradle.kts").is_file()) | |
| && root.join("build").is_dir()) | |
| } | |
| fn artifacts(&self, root: &Path) -> Vec<Artifact> { | |
| let mut artifacts = Vec::new(); | |
| if root.join("pom.xml").is_file() { | |
| let target = root.join("target"); | |
| if target.is_dir() { | |
| artifacts.push(Artifact::new(target, Ecosystem::Java)); | |
| } | |
| } | |
| if root.join("build.gradle").is_file() || root.join("build.gradle.kts").is_file() { | |
| let build = root.join("build"); | |
| if build.is_dir() { | |
| artifacts.push(Artifact::new(build, Ecosystem::Java)); | |
| } | |
| } | |
| artifacts | |
| } |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@crates/dustfril-core/src/scanner/detector.rs` around lines 77 - 93, The Java
detector currently treats Maven and Gradle the same by always matching and
returning build/, which misses standard Maven projects. Update detector.rs so
Detector::matches and Detector::artifacts distinguish pom.xml from
build.gradle/build.gradle.kts: Maven should look for target/ and return a Maven
artifact from target/, while Gradle should continue using build/; keep the
existing Java ecosystem type and ensure the helper/test cases cover pom.xml with
target/ separately from Gradle layouts.
What
Why
Closes #
Checklist
Required
cargo checkpassescargo fmt --checkpassescargo clippy --workspace --all-targets -- -D warningspassescargo testpassesFunctional Validation
Documentation
Safety
Summary by CodeRabbit
New Features
Bug Fixes
Documentation