Conversation
Docstrings generation was requested by @Meru143. * #24 (comment) The following files were modified: * `crates/argus-codelens/src/store.rs` * `crates/argus-review/src/feedback.rs` * `src/main.rs`
Entire-Checkpoint: b934bccc5ebd
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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. 📝 WalkthroughWalkthroughAdds schema initialization and embedding helpers to the on-disk CodeIndex, implements feedback persistence and retrieval in the review crate, overhaul of README content/structure, and expands the CLI main entrypoint with richer initialization and dispatch logic for subcommands and incremental review flows. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
Entire-Checkpoint: b934bccc5ebd
There was a problem hiding this comment.
Actionable comments posted: 7
🧹 Nitpick comments (4)
crates/argus-codelens/src/store.rs (2)
192-197: Doc example on private method — won't run as a doc test, but still misleading.
init_schemais a private method (line 198), so this example won't be compiled bycargo test --doc. However, the example omits the requireduseimport forCodeIndexand would not compile if it were tested. Consider either adding the import or switching totext/ignorefence to signal it's illustrative.✏️ Suggested fix
/// # Examples /// - /// ``` - /// let idx = CodeIndex::in_memory().unwrap(); - /// idx.init_schema().unwrap(); + /// ```ignore + /// let idx = CodeIndex::in_memory().unwrap(); + /// idx.init_schema().unwrap(); // private — called automatically by open/in_memory /// ```🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@crates/argus-codelens/src/store.rs` around lines 192 - 197, The doc example shows calling the private method init_schema on CodeIndex and lacks the required use import, so it is misleading and won't be compiled as a doctest; update the example in the CodeIndex docs by either adding the necessary import for CodeIndex and replacing the private call (or showing the public API that triggers schema init such as in_memory or open) so it becomes a valid doctest, or change the code fence to a non-running form (e.g., ```ignore or ```text) and add a comment that init_schema is private and is invoked internally by CodeIndex::in_memory()/CodeIndex::open so readers understand why it's shown.
878-893: Doc example forfloats_to_bytesreferences a private function — will not compile as a doc test.
floats_to_bytesis a private function (fn floats_to_bytes, line 894), so its doc example won't run. However, the example uses the bare function name without a path, which wouldn't work even if it were public. Consider switching to anignorefence.✏️ Suggested fix
/// # Examples /// - /// ``` + /// ```ignore /// let vals = [1.0f32, -2.5f32];🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@crates/argus-codelens/src/store.rs` around lines 878 - 893, The doc example for the private function floats_to_bytes will fail as a doctest because the function is not public and the example calls it by bare name; update the doc example for floats_to_bytes by either marking the example as ignored (use an ```ignore fenced block) or change the example to call the function via a valid path (or make the function public) so the doctest compiles — locate the floats_to_bytes doc comment and apply one of these fixes to the example block.crates/argus-review/src/feedback.rs (1)
92-105: Long doc comment line at line 94.Line 94 is a single very long line. While
rustfmtdoesn't reformat comments, it would improve readability to wrap it.✏️ Suggested wrap
- /// Returns a `Vec<String>` containing up to five feedback texts that were recorded with negative ratings; the vector may be empty if there are no negative entries. + /// Returns a `Vec<String>` containing up to five feedback texts that were + /// recorded with negative ratings; the vector may be empty if there are no + /// negative entries.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@crates/argus-review/src/feedback.rs` around lines 92 - 105, The doc comment for get_negative_examples contains a single excessively long line (around the paragraph starting "Returns a `Vec<String>`...") which harms readability; wrap that long sentence to ~80 chars per line (or standard rustfmt width) so the doc comment is broken into multiple shorter lines while preserving wording and markdown/code markers, and ensure the triple-backtick example block and surrounding doc lines remain unchanged; edit the comment above the pub fn get_negative_examples(&self) -> Result<Vec<String>> to reflow the long line into multiple lines.README.md (1)
164-173: Architecture section is a clean overview.The six-component pipeline maps directly to the crate structure. Minor note: "Mining" in item 3 should be lowercase for grammatical consistency with the other items ("Builds", "Analyzes", "Semantic search", etc.).
✏️ Suggested fix
-3. **`gitpulse`**: Mining git history for hotspots and coupling. +3. **`gitpulse`**: Mines git history for hotspots and coupling.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@README.md` around lines 164 - 173, Update the README architecture list item for consistency: change the word "Mining" to lowercase "mining" in the third pipeline entry (the line referencing the gitpulse component) so it matches the sentence-case style used by other items like "Builds" and "Analyzes"; edit the text that reads "**`gitpulse`**: Mining git history for hotspots and coupling." to "**`gitpulse`**: mining git history for hotspots and coupling.".
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@crates/argus-codelens/src/store.rs`:
- Around line 759-772: The doc test for the insert_feedback example omits
required imports and will fail cargo test; add a use line at the top of the code
block so the example compiles — e.g., in the doc comment for the insert_feedback
example add "use argus_codelens::store::{CodeIndex, Feedback};" before
instantiating CodeIndex and Feedback so the symbols CodeIndex and Feedback are
in scope for the doc test.
- Around line 796-802: The doc-test for feedback_counts is missing the required
import for CodeIndex; update the documentation example in the feedback_counts
docblock to include a top-line import (use argus_codelens::store::CodeIndex;)
before instantiating CodeIndex::in_memory(), so the doctest compiles and can
call idx.feedback_counts().
- Around line 837-852: The doctest example for get_negative_feedback is missing
the necessary imports; update the example in store.rs (the docblock around
get_negative_feedback) to include the import line use
argus_codelens::store::{CodeIndex, Feedback}; before creating the CodeIndex so
the types resolve in doctests and examples compile.
In `@crates/argus-review/src/feedback.rs`:
- Around line 56-69: The doc example for FeedbackStore::open/add_feedback uses
"..Default::default()" but ReviewComment does not implement Default, causing the
doctest to fail; fix by either deriving Default for the ReviewComment struct
(add Default to the derive list on the ReviewComment type) or update the example
to construct ReviewComment with explicit values for all non-optional fields
(e.g., fill in file_path, line, message and any other required fields) instead
of using ..Default::default().
In `@README.md`:
- Around line 115-121: The README example uses a non-existent flag (--limit) for
the Map subcommand; update the example to use one of the actual Map flags (e.g.,
replace `argus map --limit 20` with `argus map --max-tokens 20` or remove the
invalid flag) so it matches the Map subcommand options defined for Map (flags:
--path, --max-tokens, --focus).
- Around line 129-141: Update the README config example to match the actual
schema in crates/argus-core/src/config.rs: replace min_confidence = "high" with
a numeric value (e.g., min_confidence = 90.0) to match
ReviewConfig::min_confidence (f64), remove the nonexistent language field from
the [review] section, and drop the entire [feedback] / learning_rate entry since
there is no FeedbackConfig; instead show only valid sections such as [llm],
[review], [embedding], [paths.<path>] and one or more [[rules]] to reflect the
real config structs and keys.
In `@src/main.rs`:
- Around line 1579-1581: CI reports formatting issues in src/main.rs around the
final Ok(()) closing; run cargo fmt to normalize whitespace/newlines (remove
trailing spaces and ensure a single newline at EOF) so the closing Ok(()) and
the final brace follow rustfmt’s formatting rules; re-run cargo fmt and commit
the formatted src/main.rs so the trailing-whitespace/newline discrepancy is
resolved.
---
Nitpick comments:
In `@crates/argus-codelens/src/store.rs`:
- Around line 192-197: The doc example shows calling the private method
init_schema on CodeIndex and lacks the required use import, so it is misleading
and won't be compiled as a doctest; update the example in the CodeIndex docs by
either adding the necessary import for CodeIndex and replacing the private call
(or showing the public API that triggers schema init such as in_memory or open)
so it becomes a valid doctest, or change the code fence to a non-running form
(e.g., ```ignore or ```text) and add a comment that init_schema is private and
is invoked internally by CodeIndex::in_memory()/CodeIndex::open so readers
understand why it's shown.
- Around line 878-893: The doc example for the private function floats_to_bytes
will fail as a doctest because the function is not public and the example calls
it by bare name; update the doc example for floats_to_bytes by either marking
the example as ignored (use an ```ignore fenced block) or change the example to
call the function via a valid path (or make the function public) so the doctest
compiles — locate the floats_to_bytes doc comment and apply one of these fixes
to the example block.
In `@crates/argus-review/src/feedback.rs`:
- Around line 92-105: The doc comment for get_negative_examples contains a
single excessively long line (around the paragraph starting "Returns a
`Vec<String>`...") which harms readability; wrap that long sentence to ~80 chars
per line (or standard rustfmt width) so the doc comment is broken into multiple
shorter lines while preserving wording and markdown/code markers, and ensure the
triple-backtick example block and surrounding doc lines remain unchanged; edit
the comment above the pub fn get_negative_examples(&self) -> Result<Vec<String>>
to reflow the long line into multiple lines.
In `@README.md`:
- Around line 164-173: Update the README architecture list item for consistency:
change the word "Mining" to lowercase "mining" in the third pipeline entry (the
line referencing the gitpulse component) so it matches the sentence-case style
used by other items like "Builds" and "Analyzes"; edit the text that reads
"**`gitpulse`**: Mining git history for hotspots and coupling." to
"**`gitpulse`**: mining git history for hotspots and coupling.".
| /// # Examples | ||
| /// | ||
| /// ``` | ||
| /// use std::path::Path; | ||
| /// // Assuming FeedbackStore, ReviewComment are in scope and constructible. | ||
| /// let store = FeedbackStore::open(Path::new(".")).unwrap(); | ||
| /// let comment = ReviewComment { | ||
| /// file_path: Path::new("src/lib.rs").to_path_buf(), | ||
| /// line: 42, | ||
| /// message: "Consider renaming this variable".to_string(), | ||
| /// ..Default::default() | ||
| /// }; | ||
| /// store.add_feedback(&comment, "useful").unwrap(); | ||
| /// ``` |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# First, let's find the ReviewComment struct definition and check for Default
cd crates/argus-review/src && rg -n "struct ReviewComment" --type rust -A 10
# Check for #[derive(...Default...)] on ReviewComment
rg -n "#\[derive" crates/argus-review/src/feedback.rs -B 1 -A 5 | grep -A 5 "ReviewComment"
# Also search for explicit Default impl
rg -n "impl Default for ReviewComment" crates/argus-review/src/ --type rustRepository: Meru143/argus
Length of output: 197
🏁 Script executed:
# Find all feedback.rs files
fd -t f "feedback.rs"
# Also search for ReviewComment struct definition anywhere in the repo
rg -l "struct ReviewComment" --type rust
# List the directory structure to understand the layout
git ls-files | head -30Repository: Meru143/argus
Length of output: 948
🏁 Script executed:
# Read the feedback.rs file to see the doc example
cat -n crates/argus-review/src/feedback.rs | head -80
# Find where ReviewComment is defined
rg -n "struct ReviewComment" --type rust -A 15
# Check for Default impl
rg -n "impl Default" crates/argus-review/src/feedback.rs --type rust
rg -n "impl Default" crates/argus-core/src/types.rs --type rustRepository: Meru143/argus
Length of output: 4615
🏁 Script executed:
# Read the ReviewComment struct definition with its derive attributes
cat -n crates/argus-core/src/types.rs | sed -n '270,295p'
# Also check for any impl Default blocks for ReviewComment
rg -n "impl Default" crates/argus-core/src/types.rs -B 2 -A 5Repository: Meru143/argus
Length of output: 1138
🏁 Script executed:
# Check if there's any manual Default implementation for ReviewComment anywhere
rg -n "impl.*Default.*ReviewComment" crates/ --type rust -i
# Let's also check the full struct to ensure we see all fields
cat -n crates/argus-core/src/types.rs | sed -n '272,294p'Repository: Meru143/argus
Length of output: 1018
Fix the doc example: ReviewComment does not implement Default.
The doc example on lines 62-67 uses ..Default::default() but ReviewComment only derives Debug, Clone, Serialize, Deserialize and does not derive Default. This doc test will fail to compile. Either add Default to the derive macro on line 272 of crates/argus-core/src/types.rs, or replace the partial struct initialization with explicit field values for all non-optional fields.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@crates/argus-review/src/feedback.rs` around lines 56 - 69, The doc example
for FeedbackStore::open/add_feedback uses "..Default::default()" but
ReviewComment does not implement Default, causing the doctest to fail; fix by
either deriving Default for the ReviewComment struct (add Default to the derive
list on the ReviewComment type) or update the example to construct ReviewComment
with explicit values for all non-optional fields (e.g., fill in file_path, line,
message and any other required fields) instead of using ..Default::default().
| ```bash | ||
| argus doctor | ||
| ``` | ||
| # Visualize module structure & page rank | ||
| argus map --limit 20 | ||
|
|
||
| ## GitHub Action | ||
|
|
||
| Add automated reviews to your PRs: | ||
|
|
||
| ```yaml | ||
| name: Argus Review | ||
| on: [pull_request] | ||
| permissions: | ||
| pull-requests: write | ||
| contents: read | ||
| jobs: | ||
| review: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: { fetch-depth: 0 } | ||
| - name: Install Argus | ||
| run: npm install -g argus-ai | ||
| - name: Run Review | ||
| env: | ||
| GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| argus-ai review \ | ||
| --diff origin/${{ github.base_ref }}..HEAD \ | ||
| --pr ${{ github.repository }}#${{ github.event.pull_request.number }} \ | ||
| --post-comments \ | ||
| --fail-on bug | ||
| # Find "bus factor" risks (files only one person touches) | ||
| argus history --analysis hotspots | ||
| ``` |
There was a problem hiding this comment.
argus map --limit 20 uses a non-existent flag.
Looking at the Map subcommand definition in src/main.rs (lines 67–79), the available flags are --path, --max-tokens, and --focus. There is no --limit flag. Users following this example will get an error.
✏️ Suggested fix
-argus map --limit 20
+argus map --max-tokens 2048📝 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.
| ```bash | |
| argus doctor | |
| ``` | |
| # Visualize module structure & page rank | |
| argus map --limit 20 | |
| ## GitHub Action | |
| Add automated reviews to your PRs: | |
| ```yaml | |
| name: Argus Review | |
| on: [pull_request] | |
| permissions: | |
| pull-requests: write | |
| contents: read | |
| jobs: | |
| review: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: { fetch-depth: 0 } | |
| - name: Install Argus | |
| run: npm install -g argus-ai | |
| - name: Run Review | |
| env: | |
| GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| argus-ai review \ | |
| --diff origin/${{ github.base_ref }}..HEAD \ | |
| --pr ${{ github.repository }}#${{ github.event.pull_request.number }} \ | |
| --post-comments \ | |
| --fail-on bug | |
| # Find "bus factor" risks (files only one person touches) | |
| argus history --analysis hotspots | |
| ``` |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@README.md` around lines 115 - 121, The README example uses a non-existent
flag (--limit) for the Map subcommand; update the example to use one of the
actual Map flags (e.g., replace `argus map --limit 20` with `argus map
--max-tokens 20` or remove the invalid flag) so it matches the Map subcommand
options defined for Map (flags: --path, --max-tokens, --focus).
| ```toml | ||
| [review] | ||
| # max_comments = 5 | ||
| # min_confidence = 90 | ||
| # skip_patterns = ["*.lock", "*.min.js", "vendor/**"] | ||
| ``` | ||
| min_confidence = "high" # low, medium, high | ||
| language = "en" # Review language | ||
| skip_patterns = ["*.lock", "dist/**"] | ||
|
|
||
| ## Custom Rules | ||
| [feedback] | ||
| learning_rate = 0.1 # How fast Argus adapts | ||
|
|
||
| Argus supports natural language custom rules. Create a file at `.argus/rules.md` (or `.argus/rules/**/*.md`) to guide the AI reviewer. | ||
|
|
||
| **Example `.argus/rules.md`:** | ||
| ```markdown | ||
| - Always suggest using `anyhow::Result` instead of `Result<T, Box<dyn Error>>`. | ||
| - Flag usage of `unwrap()` in production code; suggest `expect()` or error handling. | ||
| - Ensure all public functions have doc comments. | ||
| [llm] | ||
| provider = "gemini" # gemini, openai, anthropic, ollama | ||
| model = "gemini-2.0-flash" | ||
| ``` |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check what config fields are actually supported
echo "=== DEFAULT_CONFIG in main.rs ==="
rg -A 30 'const DEFAULT_CONFIG' src/main.rs
echo "=== ArgusConfig struct ==="
ast-grep --pattern 'struct ArgusConfig {
$$$
}'
echo "=== ReviewConfig struct ==="
ast-grep --pattern 'struct ReviewConfig {
$$$
}'
echo "=== Check for feedback config ==="
rg -n 'feedback' --type rust -g '!target/**' -C 3 | grep -i 'learning_rate\|FeedbackConfig\|struct.*Config'
echo "=== Check for language config field ==="
rg -n 'language.*=.*"en"\|language.*String\|review_language\|pub.*language' --type rust -g '!target/**' | head -20Repository: Meru143/argus
Length of output: 919
🏁 Script executed:
#!/bin/bash
# Search for config struct definitions more broadly
echo "=== Searching for struct definitions ==="
rg -n 'struct.*Config\|#\[derive.*Deserialize' --type rust -B 2 -A 15 | head -100
echo "=== Looking for [llm] section definition ==="
rg -n '\[llm\]|llm.*section|llm.*provider' --type rust -C 3 | head -50
echo "=== Check config.rs or similar files ==="
fd -e rs config | xargs wc -l 2>/dev/null
echo "=== Search for all toml config references ==="
rg -n 'review.*confidence|feedback|learning_rate|language.*config' --type rust | head -20Repository: Meru143/argus
Length of output: 5015
🏁 Script executed:
cat -n crates/argus-core/src/config.rs | head -150Repository: Meru143/argus
Length of output: 5069
🏁 Script executed:
cat -n crates/argus-core/src/config.rs | sed -n '150,250p'Repository: Meru143/argus
Length of output: 4013
🏁 Script executed:
cat -n crates/argus-core/src/config.rs | sed -n '250,471p'Repository: Meru143/argus
Length of output: 8067
README config example contains multiple schema mismatches.
The config snippet at lines 129–141 includes invalid fields that don't exist in the actual config schema:
-
min_confidence = "high"— Must be a numeric value (e.g.,min_confidence = 90.0), not a string. ReviewConfig definesmin_confidenceasf64with default90.0. -
language = "en"— This field does not exist in ReviewConfig. There is no language configuration option. -
[feedback]section withlearning_rate = 0.1— There is no FeedbackConfig struct. Thefeedbackcommand in the CLI is separate from config; there's no config-driven learning rate.
Correct the example to match the actual config schema defined in crates/argus-core/src/config.rs. Valid sections are: [llm], [review], [embedding], [paths.<path>], and [[rules]].
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@README.md` around lines 129 - 141, Update the README config example to match
the actual schema in crates/argus-core/src/config.rs: replace min_confidence =
"high" with a numeric value (e.g., min_confidence = 90.0) to match
ReviewConfig::min_confidence (f64), remove the nonexistent language field from
the [review] section, and drop the entire [feedback] / learning_rate entry since
there is no FeedbackConfig; instead show only valid sections such as [llm],
[review], [embedding], [paths.<path>] and one or more [[rules]] to reflect the
real config structs and keys.
There was a problem hiding this comment.
Pull request overview
Documentation-focused update to better communicate Argus v0.4.0 capabilities (feedback loop, language support, comparison positioning) and to add richer Rustdoc to key entrypoints/APIs.
Changes:
- Overhauled
README.mdwith v0.4.0 messaging, feature comparison table, install/usage/config/integration sections. - Added/expanded Rustdoc comments across CLI entrypoint and feedback/index storage APIs.
- Added multiple Rustdoc code examples for the above APIs.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 9 comments.
| File | Description |
|---|---|
src/main.rs |
Adds high-level Rustdoc for the program entrypoint and responsibilities. |
crates/argus-review/src/feedback.rs |
Adds Rustdoc for feedback store operations, including examples. |
crates/argus-codelens/src/store.rs |
Expands Rustdoc for schema/init and feedback-related DB APIs, plus helper documentation. |
README.md |
Major rewrite to reflect v0.4.0 features and updated setup/usage/configuration guidance. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| /// ``` | ||
| /// let idx = CodeIndex::in_memory().unwrap(); | ||
| /// let fb = Feedback { | ||
| /// comment_id: "c1".into(), | ||
| /// file_path: "src/lib.rs".into(), | ||
| /// line_number: None, | ||
| /// comment_text: "This suggestion introduced a bug.".into(), | ||
| /// rating: -1, | ||
| /// timestamp: "ts".into(), | ||
| /// }; | ||
| /// idx.insert_feedback(&fb).unwrap(); | ||
| /// let msgs = idx.get_negative_feedback(10).unwrap(); | ||
| /// assert_eq!(msgs, vec!["This suggestion introduced a bug.".to_string()]); | ||
| /// ``` |
There was a problem hiding this comment.
This rustdoc example references CodeIndex and Feedback without importing/qualifying them, so the doctest will not compile. Add the appropriate use argus_codelens::store::{CodeIndex, Feedback}; (or fully qualify).
| /// ``` | ||
| /// use std::path::Path; | ||
| /// let store = argus_review::feedback::FeedbackStore::open(Path::new(".")); | ||
| /// assert!(store.is_ok()); | ||
| /// ``` |
There was a problem hiding this comment.
This rustdoc example is runnable () and will execute during doctests, which will create `.argus/index.db` under the current working directory. Consider using ` no_run (orignore) so the example is still type-checked but doesn’t perform filesystem writes during cargo test`.
| /// ``` | ||
| /// use std::path::Path; | ||
| /// // Assuming FeedbackStore, ReviewComment are in scope and constructible. | ||
| /// let store = FeedbackStore::open(Path::new(".")).unwrap(); | ||
| /// let comment = ReviewComment { | ||
| /// file_path: Path::new("src/lib.rs").to_path_buf(), | ||
| /// line: 42, | ||
| /// message: "Consider renaming this variable".to_string(), | ||
| /// ..Default::default() | ||
| /// }; | ||
| /// store.add_feedback(&comment, "useful").unwrap(); | ||
| /// ``` |
There was a problem hiding this comment.
This rustdoc example will not compile as a doctest: it references FeedbackStore without importing it, uses ReviewComment { ..Default::default() } but ReviewComment does not implement Default, and relies on types being “in scope”. Please either provide a fully-compilable snippet (with proper imports and field initialization) or mark the block as ignore to avoid failing cargo test doctests.
| /// ``` | ||
| /// let idx = CodeIndex::in_memory().unwrap(); | ||
| /// // after inserting feedback entries... | ||
| /// let (positive, negative) = idx.feedback_counts().unwrap(); | ||
| /// ``` |
There was a problem hiding this comment.
This rustdoc example references CodeIndex without importing/qualifying it, which will make the doctest fail to compile under cargo test. Add a use argus_codelens::store::CodeIndex; (or fully qualify the type).
crates/argus-codelens/src/store.rs
Outdated
| /// ``` | ||
| /// let vals = [1.0f32, -2.5f32]; | ||
| /// let bytes = floats_to_bytes(&vals); | ||
| /// assert_eq!(bytes.len(), vals.len() * 4); | ||
| /// // round-trip check for the first value | ||
| /// assert_eq!(&bytes[0..4], &1.0f32.to_le_bytes()); | ||
| /// // round-trip check for the second value | ||
| /// assert_eq!(&bytes[4..8], &(-2.5f32).to_le_bytes()); | ||
| /// ``` |
There was a problem hiding this comment.
The rustdoc example calls floats_to_bytes, but floats_to_bytes is a private free function (fn floats_to_bytes). Doctests are compiled as an external crate and cannot access private items, so this will fail cargo test doctests. Either make the function public (if intended), or mark the example as ignore, or remove the example from the public docs surface.
| /// ``` | ||
| /// // assuming `store` is a `FeedbackStore` |
There was a problem hiding this comment.
This rustdoc example will not compile as a doctest because store is not defined. Either include a minimal setup that constructs a FeedbackStore (preferably with no_run/ignore to avoid FS writes), or mark the snippet as ignore.
| /// ``` | |
| /// // assuming `store` is a `FeedbackStore` | |
| /// ```no_run | |
| /// use std::path::Path; | |
| /// // Open a FeedbackStore at the repository root. | |
| /// let store = argus_review::feedback::FeedbackStore::open(Path::new(".")).unwrap(); |
| ```toml | ||
| [review] | ||
| # max_comments = 5 | ||
| # min_confidence = 90 | ||
| # skip_patterns = ["*.lock", "*.min.js", "vendor/**"] | ||
| ``` | ||
| min_confidence = "high" # low, medium, high | ||
| language = "en" # Review language | ||
| skip_patterns = ["*.lock", "dist/**"] | ||
|
|
||
| ## Custom Rules | ||
| [feedback] | ||
| learning_rate = 0.1 # How fast Argus adapts | ||
|
|
||
| Argus supports natural language custom rules. Create a file at `.argus/rules.md` (or `.argus/rules/**/*.md`) to guide the AI reviewer. | ||
|
|
||
| **Example `.argus/rules.md`:** | ||
| ```markdown | ||
| - Always suggest using `anyhow::Result` instead of `Result<T, Box<dyn Error>>`. | ||
| - Flag usage of `unwrap()` in production code; suggest `expect()` or error handling. | ||
| - Ensure all public functions have doc comments. | ||
| [llm] | ||
| provider = "gemini" # gemini, openai, anthropic, ollama | ||
| model = "gemini-2.0-flash" |
There was a problem hiding this comment.
The config example here doesn’t match the current .argus.toml schema in argus-core: review.min_confidence is parsed as a f64 (e.g. 85.0), not a string like "high", and there is no review.language or top-level [feedback] section in ArgusConfig. As written, copying this snippet will cause TOML parse errors or silently ignored settings—please update the README to reflect the actual config keys/types supported by crates/argus-core/src/config.rs.
| /// let idx = CodeIndex::in_memory().unwrap(); | ||
| /// idx.init_schema().unwrap(); |
There was a problem hiding this comment.
The doc-test example calls idx.init_schema(), but init_schema is a private method (fn init_schema). Rustdoc tests compile the snippet as an external crate, so this example will not compile and will fail cargo test doctests. Mark the snippet as ignore, or change it to demonstrate a public API (e.g., CodeIndex::in_memory() / CodeIndex::open() which already initializes the schema).
| /// let idx = CodeIndex::in_memory().unwrap(); | |
| /// idx.init_schema().unwrap(); | |
| /// use argus_codelens::store::CodeIndex; | |
| /// | |
| /// // Creating an in-memory index automatically initializes the schema. | |
| /// let idx = CodeIndex::in_memory().unwrap(); |
| /// ``` | ||
| /// let idx = CodeIndex::in_memory().unwrap(); | ||
| /// let fb = Feedback { | ||
| /// comment_id: "c1".into(), | ||
| /// file_path: "src/lib.rs".into(), | ||
| /// line_number: Some(10), | ||
| /// comment_text: "Needs refactor".into(), | ||
| /// rating: -1, | ||
| /// timestamp: "1620000000".into(), | ||
| /// }; | ||
| /// assert!(idx.insert_feedback(&fb).is_ok()); | ||
| /// ``` |
There was a problem hiding this comment.
This rustdoc example references CodeIndex and Feedback without importing/qualifying them, so the doctest will not compile. Add the necessary use argus_codelens::store::{CodeIndex, Feedback}; (or fully qualify the paths) and consider no_run if you want to avoid relying on runtime behavior.
Entire-Checkpoint: b934bccc5ebd
There was a problem hiding this comment.
🧹 Nitpick comments (1)
crates/argus-review/src/feedback.rs (1)
13-32: Doc test foropenmay fail in CI or sandboxed environments.The doc test at lines 28–32 calls
FeedbackStore::open(Path::new("."))which will attempt to create.argus/index.dbin the current working directory. If the.argusdirectory doesn't exist or filesystem writes are restricted (e.g., read-only CI runners), this test will fail. Consider marking itno_runorignore, or ensure the test creates a temporary directory.Proposed fix
- /// ``` - /// use std::path::Path; - /// let store = argus_review::feedback::FeedbackStore::open(Path::new(".")); - /// assert!(store.is_ok()); - /// ``` + /// ```no_run + /// use std::path::Path; + /// let store = argus_review::feedback::FeedbackStore::open(Path::new(".")); + /// assert!(store.is_ok()); + /// ```🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@crates/argus-review/src/feedback.rs` around lines 13 - 32, The doc test calling FeedbackStore::open(Path::new(".")) can fail in write-restricted or sandboxed CI because it attempts to create .argus/index.db; update the doc example in feedback.rs to avoid filesystem writes by marking the fenced code block as no_run (e.g., change ``` to ```no_run) or rewrite to use a temporary directory before calling FeedbackStore::open so the test does not attempt to write in the repo root.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@crates/argus-review/src/feedback.rs`:
- Around line 56-69: The doc example uses struct update ..Default::default() for
ReviewComment but ReviewComment doesn't implement Default; either derive Default
for the struct (add Default to the derive list on the ReviewComment declaration)
or change the example to populate all required fields explicitly instead of
using ..Default::default(); update the example near FeedbackStore::open and
store.add_feedback(&comment, "useful") to reference the adjusted ReviewComment
construction or the new Default derive.
---
Nitpick comments:
In `@crates/argus-review/src/feedback.rs`:
- Around line 13-32: The doc test calling FeedbackStore::open(Path::new("."))
can fail in write-restricted or sandboxed CI because it attempts to create
.argus/index.db; update the doc example in feedback.rs to avoid filesystem
writes by marking the fenced code block as no_run (e.g., change ``` to
```no_run) or rewrite to use a temporary directory before calling
FeedbackStore::open so the test does not attempt to write in the repo root.
Entire-Checkpoint: b934bccc5ebd
Entire-Checkpoint: b934bccc5ebd
Updates README with v0.4.0 features (feedback, languages), comparison table, and improved installation instructions.
Summary by CodeRabbit
Documentation
New Features