lint
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLint
代码检查与格式化
Tooling
工具选择
Prefer lintro for linting and formatting.
When available, use and .
uv run lintro chkuv run lintro fmtIf lintro is unavailable, fall back to the language's native bundled tools (ruff,
black, clippy, rustfmt, eslint, bandit, etc.). Another skill may document an
additional pass after lintro (for example, runs after
lintro — Raycast rules take precedence for extension-specific checks).
raycastnpm run lint若lintro不可用,则使用对应语言的原生工具(ruff、black、clippy、rustfmt、eslint、bandit等)作为备选。部分技能文档可能要求在lintro之后执行额外检查步骤(例如,会在lintro之后运行——针对扩展的特定检查需优先遵循Raycast规则)。
raycastnpm run lintCommands
命令说明
- — format code
uv run lintro fmt - — check code for issues
uv run lintro chk - — run tests
uv run lintro tst
- — 格式化代码
uv run lintro fmt - — 检查代码问题
uv run lintro chk - — 运行测试
uv run lintro tst
Rules
规则要求
- CRITICAL: NEVER run (targeted/filtered checks). Always run the full
lintro chk --tools ...withoutuv run lintro chk. Filtered runs silently skip tools and miss issues.--tools- Exception: single-tool runs () are permitted only when developing or verifying that specific lintro tool (the
--tools <tool>and/lintro-addworkflows). Even then, a full/lintro-verifyis still required before committing.uv run lintro chk
- Exception: single-tool runs (
- Linting must produce zero issues before proceeding
- Fix ALL issues — whether introduced in the current session or pre-existing
- Ignore policy — suppressing a finding is not a fix:
- Fix the root cause first. ,
# noqa,# type: ignore,# nosec,# nosemgrep, etc. are a LAST resort, only when there is no reasonable fix.# yamllint disable-line - If suppression is genuinely required, use the narrowest possible
ignore — specific rule code, single line — WITH an inline justification
comment (). Unjustified ignores are rejected.
# nosec B603 - fixed argv list, no shell - Blanket or file-level ignores (whole-file disables, config-wide
excludes) require a documented exception (e.g. in ).
CONTRIBUTING.md
- Fix the root cause first.
- 重要警告:禁止运行(针对性/过滤式检查)。 始终运行完整的
lintro chk --tools ...命令,不得添加uv run lintro chk参数。过滤式检查会静默跳过部分工具,导致遗漏问题。--tools- 例外情况: 仅在开发或验证特定lintro工具(和
/lintro-add工作流)时,允许运行单工具检查(/lintro-verify)。即便如此,提交代码前仍需运行完整的--tools <tool>检查。uv run lintro chk
- 例外情况: 仅在开发或验证特定lintro工具(
- 代码检查必须确保零问题后,才能继续后续操作
- 修复所有问题——无论是当前会话引入的还是预先存在的
- 忽略规则——抑制问题提示不等于修复:
- 优先修复根本原因。 、
# noqa、# type: ignore、# nosec、# nosemgrep等忽略注释仅作为最后手段,仅在无合理修复方案时使用。# yamllint disable-line - 若确实需要抑制提示,请使用范围最窄的忽略方式——指定规则代码、仅针对单行——并添加行内说明注释(例如)。无合理说明的忽略将被拒绝。
# nosec B603 - fixed argv list, no shell - 全局或文件级忽略(禁用整个文件、配置全局排除)需有文档记录的例外说明(例如在中)。
CONTRIBUTING.md
- 优先修复根本原因。
Usage
使用流程
When asked to lint or format code:
- Run FIRST to auto-fix formatting issues across the ENTIRE codebase (when lintro is available)
uv run lintro fmt - Run to check for remaining issues (when lintro is available)
uv run lintro chk - If lintro is unavailable, use native tooling for the language and still aim for zero issues
- Manually fix any issues found — do not leave issues unfixed
- Re-run the check command to verify all fixes
- Only as a last resort, add ignore comments WITH justification
当需要进行代码检查或格式化时:
- 首先运行,自动修复整个代码库中的格式化问题(当lintro可用时)
uv run lintro fmt - 运行检查剩余问题(当lintro可用时)
uv run lintro chk - 若lintro不可用,使用对应语言的原生工具,仍需确保零问题
- 手动修复所有发现的问题——不得遗留未修复的问题
- 重新运行检查命令,验证所有修复是否完成
- 仅作为最后手段,添加带有说明的忽略注释