Ruff Linter 和 Formatter
Ultra-fast Python linting and formatting using Ruff CLI with pyproject.toml configuration. Supports auto-fix, import sorting (isort-compatible), and rule selection from 800+ built-in rules.
Prerequisites
Python
Installation
Use the upstream install or setup path that matches your environment:
- uv tool install ruff@latest # Install Ruff globally.
- uv add --dev ruff # Or add Ruff to your project.
- pip install ruff
- pipx install ruff
Requirements and caveats from upstream:
-
-
- An extremely fast Python linter and code formatter, written in Rust.
Basic usage or getting-started notes:
- Getting Started
- For more, see the documentation.
- Ruff is available as ruff on PyPI.
- Source: https://github.com/1991513ccie-png/skills
- Extracted from upstream docs: https://raw.githubusercontent.com/astral-sh/ruff/HEAD/README.md
Documentation
- https://docs.astral.sh/ruff/