lint

GitHub

指导开发者对修改的文件运行 pre-commit 进行代码检查和格式化。涵盖安装配置、处理自动修复后的剩余错误(如添加缺失导入)、管理 pyproject.toml 中的排除规则,以及参考相关配置文件和文档。

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

Trigger Scenarios

用户要求检查代码风格或格式 用户询问如何运行 linting 检查 用户遇到 pre-commit 报错需要解决

Install

npx skills add ray-project/ray --skill lint -g -y
More Options

Non-standard path

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

Use without installing

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")

Version History

  • 3fb63d9 Current 2026-07-25 11:18

Same Skill Collection

.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

Metadata

Files
0
Version
7bbef5a
Hash
a47670f1
Indexed
2026-07-25 11:18

trang chủ - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-02 01:07
浙ICP备14020137号-1 $bản đồ khách truy cập$