qlty-check
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseQlty Code Quality
Qlty 代码质量
Universal code quality tool supporting 70+ linters for 40+ languages via qlty CLI.
一款通用代码质量工具,通过qlty CLI支持40+种语言的70+款代码检查器(linter)。
When to Use
适用场景
- Check code for linting issues before commit/handoff
- Auto-fix formatting and style issues
- Calculate code metrics (complexity, duplication)
- Find code smells
- 在提交/交接代码前检查代码中的lint问题
- 自动修复格式与风格问题
- 计算代码指标(复杂度、重复率)
- 识别代码异味
Quick Reference
快速参考
bash
undefinedbash
undefinedCheck changed files with auto-fix
检查变更文件并自动修复
uv run python -m runtime.harness scripts/qlty_check.py --fix
uv run python -m runtime.harness scripts/qlty_check.py --fix
Check all files
检查所有文件
uv run python -m runtime.harness scripts/qlty_check.py --all
uv run python -m runtime.harness scripts/qlty_check.py --all
Format files
格式化文件
uv run python -m runtime.harness scripts/qlty_check.py --fmt
uv run python -m runtime.harness scripts/qlty_check.py --fmt
Get metrics
获取指标
uv run python -m runtime.harness scripts/qlty_check.py --metrics
uv run python -m runtime.harness scripts/qlty_check.py --metrics
Find code smells
识别代码异味
uv run python -m runtime.harness scripts/qlty_check.py --smells
undefineduv run python -m runtime.harness scripts/qlty_check.py --smells
undefinedParameters
参数说明
| Parameter | Description |
|---|---|
| Run linters (default) |
| Auto-fix issues |
| Process all files, not just changed |
| Format files instead |
| Calculate code metrics |
| Find code smells |
| Specific files/directories |
| Min issue level: note/low/medium/high |
| Working directory |
| Initialize qlty in a repo |
| List available plugins |
| 参数 | 描述 |
|---|---|
| 运行代码检查器(默认选项) |
| 自动修复问题 |
| 处理所有文件,而非仅变更文件 |
| 执行文件格式化 |
| 计算代码指标 |
| 识别代码异味 |
| 指定文件/目录 |
| 最小问题级别:note/low/medium/high |
| 工作目录 |
| 在仓库中初始化qlty |
| 列出可用插件 |
Common Workflows
常见工作流
After Implementation
开发完成后
bash
undefinedbash
undefinedAuto-fix what's possible, see what remains
自动修复可修复问题,查看剩余问题
uv run python -m runtime.harness scripts/qlty_check.py --fix
undefineduv run python -m runtime.harness scripts/qlty_check.py --fix
undefinedQuality Report
质量报告
bash
undefinedbash
undefinedGet metrics for changed code
获取变更代码的指标
uv run python -m runtime.harness scripts/qlty_check.py --metrics
uv run python -m runtime.harness scripts/qlty_check.py --metrics
Find complexity hotspots
定位复杂度热点
uv run python -m runtime.harness scripts/qlty_check.py --smells
undefineduv run python -m runtime.harness scripts/qlty_check.py --smells
undefinedInitialize in New Repo
在新仓库中初始化
bash
uv run python -m runtime.harness scripts/qlty_check.py --init --cwd /path/to/repobash
uv run python -m runtime.harness scripts/qlty_check.py --init --cwd /path/to/repoDirect CLI (if qlty installed)
直接使用CLI(已安装qlty时)
bash
undefinedbash
undefinedCheck changed files
检查变更文件
qlty check
qlty check
Auto-fix
自动修复
qlty check --fix
qlty check --fix
JSON output
输出JSON格式结果
qlty check --json
qlty check --json
Format
格式化文件
qlty fmt
undefinedqlty fmt
undefinedRequirements
依赖要求
- qlty CLI: https://github.com/qltysh/qlty
- MCP server: wraps CLI
servers/qlty/server.py - Config: in repo (run
.qlty/qlty.tomlfirst)qlty init
- qlty CLI:https://github.com/qltysh/qlty
- MCP server:用于封装CLI
servers/qlty/server.py - 配置文件:仓库中的(需先运行
.qlty/qlty.toml生成)qlty init
vs Other Tools
与其他工具对比
| Tool | Use Case |
|---|---|
| qlty | Unified linting, formatting, metrics for any language |
| ast-grep | Structural code patterns and refactoring |
| morph | Fast text search |
| 工具 | 适用场景 |
|---|---|
| qlty | 为任意语言提供统一的代码检查、格式化与指标分析功能 |
| ast-grep | 结构化代码模式匹配与重构 |
| morph | 快速文本搜索 |