| name | ruff-format |
| description | 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. |
Ruff Format
Workflow
- Resolve and enter the public HoloMotion Git root.
- Source
train.env.
- Verify
"$Train_CONDA_PREFIX/bin/ruff" exists.
- 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.