ruff

ruff is for linting and formatting Python code. Use it when you need to set up Python code checks, replace flake8/black/isort, configure code quality rules, or speed up Python code formatting.

Last repository push
GitHub Stars
219
Forks
38
Issues / PRs
7

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "ruff" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-9453609e864b76dd300abd4ca2559656e09f5683dfa13ad84103b93b770ee378. Verify the upstream source and version against https://github.com/TerminalSkills/skills before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

github.com

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

ruff is for linting and formatting Python code. Use it when you need to set up Python code checks, replace flake8/black/isort, configure code quality rules, or speed up Python code formatting.

0 Downloads

Introduction source: third_party · TerminalSkills · 1.0.0 Reference

SkillPi interpretation

Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: ruff
description: >-
  Lint and format Python with Ruff. Use when a user asks to set up Python
  linting, replace flake8/black/isort, configure code quality rules, or
  speed up Python code formatting.
license: Apache-2.0
compatibility: 'Python 3.7+'
metadata:
  author: terminal-skills
  version: 1.0.0
  category: development
  tags:
    - ruff
    - linting
    - formatting
    - python
    - code-quality

Ruff

Overview

Ruff is an extremely fast Python linter and formatter written in Rust. It replaces flake8, black, isort, pyupgrade, pydocstyle, and dozens more tools — running 10-100x faster. One tool for all Python code quality.

Instructions

Step 1: Setup

pip install ruff

Step 2: Configuration

# pyproject.toml — Ruff configuration
[tool.ruff]
target-version = "py311"
line-length = 100
src = ["src", "tests"]

[tool.ruff.lint]
select = [
    "E",    # pycodestyle errors
    "W",    # pycodestyle warnings
    "F",    # pyflakes
    "I",    # isort (import sorting)
    "B",    # flake8-bugbear
    "C4",   # flake8-comprehensions
    "UP",   # pyupgrade
    "SIM",  # flake8-simplify
    "TCH",  # flake8-type-checking
    "RUF",  # ruff-specific rules
]
ignore = [
    "E501",   # line too long (handled by formatter)
]
fixable = ["ALL"]

[tool.ruff.lint.isort]
known-first-party = ["my_app"]

[tool.ruff.format]
quote-style = "double"
indent-style = "space"
docstring-code-format = true

Step 3: Use

# Lint
ruff check .                   # check all files
ruff check . --fix             # auto-fix issues
ruff check . --fix --unsafe-fixes  # include risky auto-fixes

# Format
ruff format .                  # format all files
ruff format --check .          # check without modifying (CI)

# Watch mode
ruff check --watch .

Step 4: Pre-commit Hook

# .pre-commit-config.yaml
repos:
  - repo: https://github.com/astral-sh/ruff-pre-commit
    rev: v0.3.0
    hooks:
      - id: ruff
        args: [--fix]
      - id: ruff-format

Step 5: CI Integration

# .github/workflows/lint.yml
- name: Lint with Ruff
  run: |
    ruff check . --output-format=github
    ruff format --check .

Guidelines

  • Ruff replaces flake8, black, isort, pyupgrade in a single tool — remove the old ones.
  • Start with a broad rule set (select = ["E", "W", "F", "I", "B", "UP"]) and expand.
  • ruff check --fix auto-fixes most issues — safe to run in pre-commit hooks.
  • Ruff processes the entire CPython codebase in under 200ms — linting is no longer a bottleneck.
  • Use ruff format as a drop-in replacement for black — same output, 100x faster.

Current listing version

1.0.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value92/100

Highlights

  • 高价值 Python 代码质量管理工具,直接解决开发者核心痛点
  • 覆盖代码检查、格式化、CI/CD 集成等完整工作流
Trigger Precision95/100

Highlights

  • 触发词精准覆盖 Python 代码检查、格式化、工具替换等核心场景
  • 边界清晰,不易与其他 Skill 重叠
Structure and Standards95/100

Highlights

  • 五步式清晰结构:安装→配置→使用→pre-commit→CI 集成
  • 提供完整端到端示例,frontmatter 规范完整
Execution Reliability90/100

Highlights

  • 工具来源明确,参数正确,覆盖主要使用场景
  • 提供安全检查机制(--check)和自动修复选项
Evidence Verifiability (mean of the first four)93/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

  • Install or fetch external dependencies

    Use official sources and pin versions. Check install scripts in an isolated environment. This document check does not cover code downloaded later.

    Mentioned in main document · lines 32
Domains or addresses referenced in the document

These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.

  • github.com

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.