lint

GitHub

指导开发者对修改的代码运行 pre-commit 进行静态检查和格式化,处理自动修复后的剩余错误,管理排除配置,确保代码质量。

.claude/skills/lint/SKILL.md ray-project/ray

触发场景

执行代码静态检查 修复代码格式或规范问题

安装

npx skills add ray-project/ray --skill lint -g -y
更多选项

非标准路径

npx skills add https://github.com/ray-project/ray/tree/master/.claude/skills/lint -g -y

不安装直接使用

npx skills use ray-project/ray@lint

指定 Agent (Claude Code)

npx skills add ray-project/ray --skill lint -a claude-code -g -y

安装 repo 全部 skill

npx skills add ray-project/ray --all -g -y

预览 repo 内 skill

npx skills add ray-project/ray --list

SKILL.md

Frontmatter
{
    "name": "lint",
    "description": "Run linting and formatting checks on Ray code"
}

Lint Modified Files

Run pre-commit on the files you changed:

pre-commit run --files $(git diff --name-only HEAD)

pre-commit run without --files only operates on staged files, so pass the modified file list explicitly.

If pre-commit is not installed:

pip install -c python/requirements_compiled.txt pre-commit && pre-commit install

Handling remaining errors

Pre-commit auto-fixes simple issues (formatting, long lines, unused imports). Review any remaining errors — these typically need code changes such as adding a missing import, resolving a name conflict, or restructuring logic. Fix them by editing the source code directly.

Use # noqa only for false positives that cannot be resolved by changing the code, and include the rule code and reason: # noqa: E501 — URL cannot be split.

Exclusions

pyproject.toml lists files in per-file-ignores and extend-exclude. When the PR modifies a file that is on one of these lists, fix the lint issues in your changes and consider removing the file from the list. Leave exclusion entries for files outside the PR scope untouched.

Reference

  • Hook config: .pre-commit-config.yaml
  • Ruff config: pyproject.toml ([tool.ruff] section)
  • Docs: doc/source/ray-contribute/development.md ("Development tooling")

版本历史

  • 3fb63d9 当前 2026-07-25 11:18

同 Skill 集合

.claude/skills/fetch-buildkite-logs/SKILL.md
.claude/skills/ray-dependencies/SKILL.md
.claude/skills/rebuild/SKILL.md
doc/.claude/skills/ray-soft-wrap/SKILL.md
doc/.claude/skills/rst-to-myst/SKILL.md
doc/.claude/skills/sphinx-fix/SKILL.md

元信息

文件数
0
版本
84a62d2
Hash
a47670f1
收录时间
2026-07-25 11:18

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-25 19:33
浙ICP备14020137号-1 $访客地图$