feat: add outline rule definition#2691
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughIntroduces a new ChangesOutline Rule Configuration and Validation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2691 +/- ##
==========================================
+ Coverage 86.47% 86.50% +0.02%
==========================================
Files 118 119 +1
Lines 20266 20342 +76
==========================================
+ Hits 17525 17596 +71
- Misses 2741 2746 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
crates/cli/src/outline/rule.rs (1)
27-27: ⚡ Quick winConsider deriving
Debugfor consistency.The serializable and runtime rule structs do not derive
Debug, while other types in this module (OutlineNameSource,OutlineRoleError) and the model module (SymbolType,OutlineRole,OutlineRoles,OutlineItem) all deriveDebug. AddingDebugtoSerializableOutlineRule,SerializableOutlineRuleSet, andOutlineRulewould improve debugging ergonomics and maintain consistency with the codebase conventions.Suggested Debug derives
-#[derive(Clone, Deserialize)] +#[derive(Debug, Clone, Deserialize)] #[serde(rename_all = "camelCase")] pub struct SerializableOutlineRule {-#[derive(Clone, Deserialize)] +#[derive(Debug, Clone, Deserialize)] #[serde(rename_all = "camelCase")] pub struct SerializableOutlineRuleSet {-#[derive(Clone)] +#[derive(Debug, Clone)] pub struct OutlineRule {Also applies to: 46-46, 54-54
🤖 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/cli/src/outline/rule.rs` at line 27, Add the Debug derive to the three rule-related types to match other types and improve debugging: update the derive attributes for SerializableOutlineRule (currently #[derive(Clone, Deserialize)]) to #[derive(Clone, Deserialize, Debug)], for SerializableOutlineRuleSet to include Debug, and for OutlineRule to include Debug as well; ensure the Debug derive is added alongside the existing derives for each struct (SerializableOutlineRule, SerializableOutlineRuleSet, OutlineRule).
🤖 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.
Nitpick comments:
In `@crates/cli/src/outline/rule.rs`:
- Line 27: Add the Debug derive to the three rule-related types to match other
types and improve debugging: update the derive attributes for
SerializableOutlineRule (currently #[derive(Clone, Deserialize)]) to
#[derive(Clone, Deserialize, Debug)], for SerializableOutlineRuleSet to include
Debug, and for OutlineRule to include Debug as well; ensure the Debug derive is
added alongside the existing derives for each struct (SerializableOutlineRule,
SerializableOutlineRuleSet, OutlineRule).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 7054430c-b294-4d89-9165-21e693b78eac
📒 Files selected for processing (3)
crates/cli/src/outline.rscrates/cli/src/outline/model.rscrates/cli/src/outline/rule.rs
979c7e6 to
99cc41e
Compare
99cc41e to
a48b64b
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (3)
crates/cli/src/outline/rule.rs (3)
19-35: ⚡ Quick winConsider adding Debug derive for easier debugging.
The struct lacks a
Debugderive, which would be helpful during development and troubleshooting. Since all field types already implement Debug (String, SgLang, SymbolType, Vec, SerializableRuleCore), adding it is straightforward.🔍 Proposed enhancement
-#[derive(Clone, Deserialize)] +#[derive(Clone, Debug, Deserialize)] #[serde(rename_all = "camelCase")] pub struct SerializableOutlineRule {🤖 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/cli/src/outline/rule.rs` around lines 19 - 35, The SerializableOutlineRule struct is missing a Debug derive which makes printing and debugging instances harder; add Debug to the derive list on the SerializableOutlineRule struct (alongside Clone and Deserialize) so the type implements std::fmt::Debug—update the attribute to #[derive(Clone, Deserialize, Debug)] for SerializableOutlineRule.
46-60: ⚡ Quick winConsider adding Debug derive for easier debugging.
The runtime struct lacks a
Debugderive. Adding it would improve debuggability during development and when troubleshooting rule normalization issues.🔍 Proposed enhancement
-#[derive(Clone)] +#[derive(Clone, Debug)] pub struct OutlineRule {🤖 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/cli/src/outline/rule.rs` around lines 46 - 60, The OutlineRule struct is missing a Debug derive which makes debugging harder; update the struct definition for OutlineRule to add #[derive(Clone, Debug)] (or include Debug alongside existing derives) so instances can be formatted for logs and debugging, ensuring the derive applies to the struct that contains fields id, language (SgLang), symbol_type (SymbolType), roles (OutlineRoles), name, and core (SerializableRuleCore).
38-43: ⚡ Quick winConsider adding Debug derive for easier debugging.
Similar to
SerializableOutlineRule, this struct would benefit from aDebugderive for development and troubleshooting.🔍 Proposed enhancement
-#[derive(Clone, Deserialize)] +#[derive(Clone, Debug, Deserialize)] #[serde(rename_all = "camelCase")] pub struct SerializableOutlineRuleSet {🤖 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/cli/src/outline/rule.rs` around lines 38 - 43, The struct SerializableOutlineRuleSet is missing a Debug derive which makes debugging harder; add Debug to its derive list (i.e., change #[derive(Clone, Deserialize)] to #[derive(Clone, Debug, Deserialize)]) so SerializableOutlineRuleSet instances can be formatted in logs and debuggers, mirroring the existing SerializableOutlineRule derive usage.
🤖 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.
Nitpick comments:
In `@crates/cli/src/outline/rule.rs`:
- Around line 19-35: The SerializableOutlineRule struct is missing a Debug
derive which makes printing and debugging instances harder; add Debug to the
derive list on the SerializableOutlineRule struct (alongside Clone and
Deserialize) so the type implements std::fmt::Debug—update the attribute to
#[derive(Clone, Deserialize, Debug)] for SerializableOutlineRule.
- Around line 46-60: The OutlineRule struct is missing a Debug derive which
makes debugging harder; update the struct definition for OutlineRule to add
#[derive(Clone, Debug)] (or include Debug alongside existing derives) so
instances can be formatted for logs and debugging, ensuring the derive applies
to the struct that contains fields id, language (SgLang), symbol_type
(SymbolType), roles (OutlineRoles), name, and core (SerializableRuleCore).
- Around line 38-43: The struct SerializableOutlineRuleSet is missing a Debug
derive which makes debugging harder; add Debug to its derive list (i.e., change
#[derive(Clone, Deserialize)] to #[derive(Clone, Debug, Deserialize)]) so
SerializableOutlineRuleSet instances can be formatted in logs and debuggers,
mirroring the existing SerializableOutlineRule derive usage.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 61416709-cbdd-4e31-af19-aaffd707f3b7
📒 Files selected for processing (3)
crates/cli/src/outline.rscrates/cli/src/outline/model.rscrates/cli/src/outline/rule.rs
✅ Files skipped from review due to trivial changes (1)
- crates/cli/src/outline.rs
🚧 Files skipped from review as they are similar to previous changes (1)
- crates/cli/src/outline/model.rs
|
Great, I'll reuse some of these features downstream! <3 One less moving part to maintain. |
Summary
SerializableRuleCoreOutlineRolesflags and reject empty role setsNotes
SymbolTypeandOutlineRolenow deriveDeserializeso extractor definitions can use their existing model valuesTest
Summary by CodeRabbit