Skip to content

fix(v0.15.1): clippy清零 + feature-flags warnings + crate README补全#9

Merged
juice094 merged 4 commits into
mainfrom
fix/v0.15.1-optimizations
May 11, 2026
Merged

fix(v0.15.1): clippy清零 + feature-flags warnings + crate README补全#9
juice094 merged 4 commits into
mainfrom
fix/v0.15.1-optimizations

Conversation

@juice094
Copy link
Copy Markdown
Owner

P0/P1 优化合集:

编译健康度

  • 修复 symbol_index.rs needless_borrows
  • 修复 health.rs collapsible_if (let-chains)
  • 修复 devbase-embedding redundant_closure
  • cargo fix 自动修复剩余项
  • cargo clippy --workspace --all-targets: 0 warnings

Feature Flags

  • semantic_index/symbol.rs + call_graph.rs 添加条件 allow(dead_code)
  • cargo clippy --no-default-features: 0 warnings
  • cargo clippy --features tui/mcp: 0 warnings

文档治理 (RF-7)

  • 补写 18 个缺失 README 的 workspace crate
  • 覆盖率 1/19 → 19/19 (100%)
  • 包含一句话职责、边界说明、深度链接

验证: cargo check --workspace 0 errors; cargo fmt --check pass

juice094 added 3 commits May 11, 2026 09:43
**Clippy 修复 (3 处手动 + cargo fix 自动)**:
- symbol_index.rs:89: needless_borrows_for_generic_args
   →
- health.rs:511: collapsible_if
  嵌套  → let-chains
- devbase-embedding/src/lib.rs:364: redundant_closure
   →
- cargo fix 自动应用剩余可修复项

**文档治理 (RF-7 三层摘要)**:
- 为 18 个缺失 README 的 workspace crate 生成最小可用 README
- 包含:一句话职责、边界说明、深度链接、许可证
- 覆盖率: 1/19 → 19/19 (100%)

验证:
- cargo check --workspace: 0 errors
- cargo clippy --workspace --all-targets: 0 warnings
- cargo fmt --check: pass
semantic_index/symbol.rs and call_graph.rs contain language-specific
functions that are unused when all lang-* features are disabled.

Add conditional #![allow(dead_code, unused_imports, unused_variables)]
that only activates when no tree-sitter grammar features are enabled:

This preserves zero-warning builds for:
- cargo clippy --workspace --all-targets  (0 warnings)
- cargo clippy --no-default-features       (0 warnings)
- cargo clippy --features tui              (0 warnings)
- cargo clippy --features mcp              (0 warnings)

验证: cargo check --workspace 0 errors
@juice094 juice094 force-pushed the fix/v0.15.1-optimizations branch from 7f40b9f to 731bb66 Compare May 11, 2026 04:30
**问题**: health.rs 是项目中 crate:: 引用最多的文件 (29 处),
违反 RF-7 的耦合健康度约束。

**方案**:
1. 提取  /  /  到
    子模块
2. health.rs 通过  向后兼容 re-export
3. 集中导入外部模块,消除行内 crate:: 引用:
   -
   -
   -
   -

**效果**:
- health.rs crate:: 引用: 29 → 7 (-76%)
- env_cache.rs 职责单一:环境工具链版本检测 + 格式化
- 零运行时行为变更

验证:
- cargo check --workspace: 0 errors
- cargo clippy --workspace --all-targets: 0 warnings
- cargo test --workspace: 503 passed / 0 failed / 4 ignored
@juice094 juice094 merged commit e2fec72 into main May 11, 2026
6 checks passed
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.

1 participant