lint

GitHub

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

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

Trigger Scenarios

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

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
84a62d2
Hash
a47670f1
Indexed
2026-07-25 11:18

- 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-20 09:43
浙ICP备14020137号-1 $방문자$