fix(v0.15.1): clippy清零 + feature-flags warnings + crate README补全#9
Merged
Conversation
**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
7f40b9f to
731bb66
Compare
**问题**: 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
P0/P1 优化合集:
编译健康度
Feature Flags
文档治理 (RF-7)
验证: cargo check --workspace 0 errors; cargo fmt --check pass