qlty-check

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Qlty 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
undefined
bash
undefined

Check 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
undefined
uv run python -m runtime.harness scripts/qlty_check.py --smells
undefined

Parameters

参数说明

ParameterDescription
--check
Run linters (default)
--fix
Auto-fix issues
--all
Process all files, not just changed
--fmt
Format files instead
--metrics
Calculate code metrics
--smells
Find code smells
--paths
Specific files/directories
--level
Min issue level: note/low/medium/high
--cwd
Working directory
--init
Initialize qlty in a repo
--plugins
List available plugins
参数描述
--check
运行代码检查器(默认选项)
--fix
自动修复问题
--all
处理所有文件,而非仅变更文件
--fmt
执行文件格式化
--metrics
计算代码指标
--smells
识别代码异味
--paths
指定文件/目录
--level
最小问题级别:note/low/medium/high
--cwd
工作目录
--init
在仓库中初始化qlty
--plugins
列出可用插件

Common Workflows

常见工作流

After Implementation

开发完成后

bash
undefined
bash
undefined

Auto-fix what's possible, see what remains

自动修复可修复问题,查看剩余问题

uv run python -m runtime.harness scripts/qlty_check.py --fix
undefined
uv run python -m runtime.harness scripts/qlty_check.py --fix
undefined

Quality Report

质量报告

bash
undefined
bash
undefined

Get 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
undefined
uv run python -m runtime.harness scripts/qlty_check.py --smells
undefined

Initialize in New Repo

在新仓库中初始化

bash
uv run python -m runtime.harness scripts/qlty_check.py --init --cwd /path/to/repo
bash
uv run python -m runtime.harness scripts/qlty_check.py --init --cwd /path/to/repo

Direct CLI (if qlty installed)

直接使用CLI(已安装qlty时)

bash
undefined
bash
undefined

Check 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
undefined
qlty fmt
undefined

Requirements

依赖要求

  • qlty CLIhttps://github.com/qltysh/qlty
  • MCP server
    servers/qlty/server.py
    用于封装CLI
  • 配置文件:仓库中的
    .qlty/qlty.toml
    (需先运行
    qlty init
    生成)

vs Other Tools

与其他工具对比

ToolUse Case
qltyUnified linting, formatting, metrics for any language
ast-grepStructural code patterns and refactoring
morphFast text search
工具适用场景
qlty为任意语言提供统一的代码检查、格式化与指标分析功能
ast-grep结构化代码模式匹配与重构
morph快速文本搜索