闪闪发光
     ](https://pypi.org/project/glintefy/)    
代码审查和自动修复工具-作为CLI和MCP服务器提供。
它可用,但处于非常早期的测试阶段——高流失率和制动变化——发布以确保pypi包名称
MCP部分完全未经测试且无法运行——CLI子服务器正在工作,但仍在开发中
______________________________________________________________________
什么是闪闪发光?
glintefy提供全面的代码分析:
- 18+质量分析:复杂性、可维护性、重复性、类型覆盖率、死代码
- 安全扫描:用于漏洞检测的Bandit集成
- 缓存优化:基于证据
@lru_cache建议 - 文件覆盖范围:文档字符串完整性分析
有两种使用方法:
| 模式 | 最适合 |
|---|---|
| 命令行界面 | 直接命令行使用、CI/CD管道、脚本 |
| MCP服务器 | 与Claude Desktop集成,人工智能辅助工作流程 |
______________________________________________________________________
快速开始
安装
# Recommended: uv
pip install uv
uv pip install glintefy
# Alternative: pip
pip install glintefy
# Development
git clone https://github.com/bitranox/glintefy
cd glintefy && make devCLI用法(简单)
# Deploy configuration (recommended first step) - this creates a config file with the settings for all tests to adjust
glintefy config-deploy --target app
# Review uncommitted git changes (default)
glintefy review all
# Review all files
glintefy review all --mode full
# Run specific analysis
glintefy review quality
glintefy review security
# Cache optimization with profiling (recommended)
glintefy review profile -- python -m your_app # Profile your app
glintefy review profile -- pytest tests/ # Or profile tests
glintefy review cache # Then analyze
# Clean up analysis data
glintefy review clean # Delete all
glintefy review clean -s profile # Delete profile only
glintefy review clean --dry-run # Preview deletionMCP服务器使用(简单)
添加到Claude桌面配置(~/.config/claude/claude_desktop_config.json):
{
"mcpServers": {
"glintefy-review": {
"command": "python",
"args": ["-m", "glintefy.servers.review"]
}
}
}然后在Claude Desktop中:
“检查此项目的代码质量”
______________________________________________________________________
文档
入门指南
用户指南
发展
______________________________________________________________________
功能概述
可用分析
| 分析 | 描述 | CLI命令 |
|---|---|---|
| 范围 | 文件发现、git更改 | review scope |
| 质量 | 复杂性、可维护性、重复性 | review quality |
| 安全 | 漏洞扫描(Bandit) | review security |
| 依赖项 | 过时的软件包、漏洞 | review deps |
| 文档 | 文档字符串覆盖率 | review docs |
| 演出 | 热点检测、分析 | review perf |
| 缓存 | LRU缓存优化 | review cache |
质量指标
| 度量 | 工具 | 阈值 |
|---|---|---|
| 圈复杂度 | radon | ≤10 |
| 函数长度 | 自定义 | ≤50行 |
| 嵌套深度 | 自定义 | ≤3级 |
| 维修性指数 | 氡 | ≥20 |
| 类型覆盖率 | mypy | ≥80% |
| 文档字符串覆盖率 | 查询 | ≥80% |
______________________________________________________________________
需求
- Python 3.13+
- Git(可选)
Git集成
Git是 可选的 但能够实现附加功能:
| 功能 | 没有Git | 有Git |
|---|---|---|
| 范围模式 | --mode full 扫描所有文件 | --mode git 仅扫描未提交的更改(默认) |
| 代码改动 | 跳过 | 分析频繁修改的文件 |
| 分支信息 | 显示“N/A” | 显示当前分支 |
当git不可用时:
--mode git自动回退到--mode full带有警告- 代码流失分析被自动跳过
- 缓存分析无需git即可工作(使用内存中的文件备份)
- 所有其他分析工作正常
______________________________________________________________________
许可证
______________________________________________________________________
