vale
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseVale Lint & Fix
Vale Lint & Fix
Run Vale on files, then fix issues directly based on the lint output.
对文件运行Vale,然后基于lint输出直接修复问题。
Workflow
工作流
- Run Vale with JSON output on the target file(s):
bash
vale --output=JSON <file-or-glob>-
Parse the JSON output. Each issue has:
- ,
Line(column range) — locationSpan - — rule name (e.g.
Check,Microsoft.Passive)write-good.Weasel - — human-readable explanation
Message - —
Severity,error, orwarningsuggestion - — suggested fix type (
Action.Name,replace,remove)edit - — replacement candidates
Action.Params
-
Read the file and fix each issue:
- For actions with clear suggestions: apply the best-fit replacement
replace - For stylistic issues (passive voice, wordiness, weasel words): rewrite the sentence
- For issues requiring judgment: use context to determine the best fix
- Skip rules that conflict with the document's domain (e.g. medical terminology flagged as jargon)
- For
-
Re-run Vale after fixes to verify issues are resolved. Repeat if needed.
- 运行Vale,对目标文件输出JSON格式结果:
bash
vale --output=JSON <file-or-glob>-
解析JSON输出,每个问题包含以下字段:
- 、
Line(列范围)—— 问题位置Span - —— 规则名称(例如
Check、Microsoft.Passive)write-good.Weasel - —— 可读性说明
Message - —— 问题等级:
Severity(错误)、error(警告)或warning(建议)suggestion - —— 建议修复类型:
Action.Name(替换)、replace(删除)、remove(编辑)edit - —— 替换候选内容
Action.Params
-
读取文件并修复每个问题:
- 对于有明确建议的操作:应用最合适的替换内容
replace - 对于风格类问题(被动语态、冗余表述、模糊用词):重写相关句子
- 对于需要主观判断的问题:结合上下文确定最佳修复方案
- 跳过与文档所属领域冲突的规则(例如医疗术语被标记为行话的情况)
- 对于有明确建议的
-
修复完成后重新运行Vale,验证问题已解决,必要时重复上述流程。
Scope Rules
适用规则
- If no file is specified, ask the user which file(s) to lint
- For globs (e.g. ), process each file sequentially
docs/*.md - Only fix and
errorby default; includewarningif user asks for thorough reviewsuggestion
- 如果未指定文件,询问用户需要lint的文件
- 对于通配符路径(例如 ),按顺序处理每个文件
docs/*.md - 默认仅修复和
error等级的问题;如果用户要求全面检查,则同时处理warning等级的问题suggestion
What NOT to Fix
禁止修复的内容
- Domain-specific terminology flagged incorrectly (medical, legal, technical terms)
- Intentional stylistic choices (e.g. first person in a blog post)
- Code blocks and frontmatter — Vale should already skip these, but double-check
- 被误标记的领域特定术语(医疗、法律、技术术语)
- 有意为之的风格选择(例如博客文章中使用第一人称)
- 代码块和前置元数据 —— Vale默认会跳过这些内容,但仍需二次确认