Command Palette

Search for a command to run...

Назад к скиллам
скилл № 62619

Format Code

Format Python sources in the repository with ruff and apply its safe lint fixes (pre-commit enforced).

БесплатноБез исполняемых скриптов
CERTCCот CERTCC★ 22 звезды на GitHub

Установить Format Code в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Skill: Format code with ruff

Purpose

Format Python source files with ruff format and apply ruff's safe lint fixes (import sorting among them). This keeps a consistent code style and avoids pre-commit failures.

Inputs

  • repo_root (string, default .): repository root where the command should be executed.

Outputs

  • formatted_files (string): stdout from ruff listing files fixed or reformatted.

Procedure

  1. From the repository root, run:

    uv run ruff check --fix
    uv run ruff format
    
  2. Inspect the output and stage changes if any files were rewritten.

Constraints / Rules

  • Do not pass paths. Scope is declared in [tool.ruff] in pyproject.toml (IMPLTS-07-021); ruff format excludes Markdown there, so fenced Python in docs, notes and plan/history/ is never rewritten.
  • Use markdownlint-cli2 for Markdown.
  • Formatting can rewrap a line and strand an inline pragma. run-linters runs ruff check and pyright-changed after formatting; use it before committing. A stranded # pyright: ignore[...] in a changed file is reported there, and in any other file by CI's whole-project pyright job (PAD-18-027).

Rationale

One formatter, whose import sorting and lint fixes share one configuration, keeps the pre-commit hook, the CI lint-ruff job and local runs in agreement (ADR-0221).

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл Format Code?

Format Python sources in the repository with ruff and apply its safe lint fixes (pre-commit enforced).

Как установить скилл Format Code?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл Format Code запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить Format Code с