# ruff [![Actions status](https://github.com/charliermarsh/ruff/workflows/CI/badge.svg)](https://github.com/charliermarsh/ruff/actions) [![PyPI version](https://badge.fury.io/py/ruff.svg)](https://badge.fury.io/py/ruff) An extremely fast Python linter, written in Rust.

Bar chart with benchmark results

Linting the CPython codebase from scratch.

- ⚡️ 10-100x faster than existing linters - 🐍 Installable via `pip` - 🤝 Python 3.10 compatibility - 🛠️ `pyproject.toml` support - 📦 [ESLint](https://eslint.org/docs/latest/user-guide/command-line-interface#caching)-inspired cache semantics - 👀 [TypeScript](https://www.typescriptlang.org/docs/handbook/configuring-watch.html)-inspired `--watch` semantics _ruff is a proof-of-concept and not yet intended for production use. It supports only a small subset of the Flake8 rules, and may crash on your codebase._ Read the [launch blog post](https://notes.crmarsh.com/python-tooling-could-be-much-much-faster). ## Installation and usage ### Installation Available as [ruff](https://pypi.org/project/ruff/) on PyPI: ```shell pip install ruff ``` ### Usage To run ruff, try any of the following: ```shell ruff path/to/code/to/check.py ruff path/to/code/ ruff path/to/code/*.py ``` You can run ruff in `--watch` mode to automatically re-run on-change: ```shell ruff path/to/code/ --watch ``` ## Configuration ruff is configurable both via `pyproject.toml` and the command line. For example, you could configure ruff to only enforce a subset of rules with: ```toml [tool.ruff] line-length = 88 select = [ "F401", "F403", ] ``` Alternatively, on the command-line: ```shell ruff path/to/code/ --select F401 F403 ``` See `ruff --help` for more: ```shell ruff An extremely fast Python linter. USAGE: ruff [OPTIONS] ... ARGS: ... OPTIONS: -e, --exit-zero Exit with status code "0", even upon detecting errors -h, --help Print help information --ignore ... Comma-separated list of error codes to ignore -n, --no-cache Disable cache reads -q, --quiet Disable all logging (but still exit with status code "1" upon detecting errors) --select