Ruff Format

Format HoloMotion Python files with the Ruff binary selected by train.env. Use when the user asks to format Python code, run Ruff formatting, check formatting, format changed files, or explicitly format the whole project.

horizonrobotics b68a600 1.1 KB Updated

File contents

Ruff Format

Workflow

  1. Resolve and enter the public HoloMotion Git root.
  2. Source train.env.
  3. Verify "$Train_CONDA_PREFIX/bin/ruff" exists.
  4. Determine the requested scope.

Default to explicitly requested files. If the user asks to format current changes, derive the Python file list from staged and unstaged Git changes and exclude deleted files.

"$Train_CONDA_PREFIX/bin/ruff" format --config pyproject.toml <files...>

Use check-only mode when requested:

"$Train_CONDA_PREFIX/bin/ruff" format --check --config pyproject.toml <files...>

Run project-wide formatting only when the user explicitly requests it:

"$Train_CONDA_PREFIX/bin/ruff" format --config pyproject.toml .

After formatting, inspect the diff and report files changed. Never revert unrelated user changes.

horizonrobotics/holomotion/tree/main/.agents/skills/ruff-format commit b68a600104

Frequently asked questions

npx skillmds@latest add horizonrobotics/ruff-format