Lint Modified Files

SkillDev tools

The lint skill runs linting and formatting checks on Ray code. It applies pre-commit hooks to the files an agent has modified, automatically fixing simple issues like formatting, long lines, and unused imports. Remaining errors are handled through direct code edits, sparing use of # noqa comments with reasons, and awareness of per-file exclusions.

Available today. Use it from your connected AI after setup.

Ensure pre-commit is installed; if not, install it with pip using python/requirements_compiled.txt and run pre-commit install.

Then ask your AI: use the Lint Modified Files skill

What your AI can do with it

  • Run pre-commit on files changed since HEAD
  • Auto-fix formatting, long lines, and unused imports
  • Guide direct code edits for remaining lint errors
  • Add # noqa comments with rule codes and reasons
  • Check pyproject.toml per-file-ignores and extend-exclude

Getting started

  1. Ensure pre-commit is installed; if not, install it with pip using python/requirements_compiled.txt and run pre-commit install.
  2. Identify the files you changed, for example with git diff --name-only HEAD.
  3. Run pre-commit run --files followed by the list of modified files.
  4. Review any remaining errors and fix them by editing the source code directly.
  5. Use # noqa only for false positives, including the rule code and a reason.

What this skill tells your AI

The instructions your AI receives, as published by ray-project/ray in .claude/skills/lint/SKILL.md and read by ahel’s review.

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

Signals

GitHub stars
44k
Forks
8k
Last commit
Oct 2026

ahel review

  • K1binfo
    installs-packages

Automated review, not a security audit. Ruleset v1+k2.

Questions

What does the lint skill do?
It runs pre-commit hooks over the files an agent has modified, automatically fixing simple issues like formatting, long lines, and unused imports, then guides handling of remaining errors through direct code edits.
How do I run pre-commit on modified files?
Use pre-commit run --files $(git diff --name-only HEAD). Without --files, pre-commit only operates on staged files, so pass the modified file list explicitly.
What if pre-commit is not installed?
Install it with pip install -c python/requirements_compiled.txt pre-commit and then run pre-commit install.
Advanced
Item type
skill
Key
lint-ray-project
Source
github.com/ray-project/ray