Ruff is a free tool that checks your Python code for mistakes and formats it neatly, in one program. Run ruff check in a project and it lists unused imports, undefined names, likely bugs and style problems, and ruff check --fix repairs many of them; ruff format rewrites your files in the same style as Black. The project measures it at 10 to 100 times faster than Flake8 and Black.
It earns its place because it replaces a stack of separate tools, Flake8 and dozens of its plugins, isort, Black, pyupgrade, autoflake and pydocstyle, with one binary and one block of settings in pyproject.toml. It has over 900 rules you switch on by group, caches results so unchanged files are skipped, checks Jupyter notebooks, and has an official VS Code extension and a language server for other editors. FastAPI, pandas, SciPy and Apache Airflow use it, and you can try it without installing anything at play.ruff.rs, the project's own playground.
Ruff is MIT-licensed and written in Rust. Charlie Marsh started it in 2022, and his company Astral maintains it alongside uv; in March 2026 Astral announced it is joining OpenAI's Codex team and said its tools will stay open source. The same repository holds ty, Astral's type checker. It has about 51,600 stars and over 1,000 contributors. Version 0.17.6 came out on 19 November 2026.
- Repository: github.com/astral-sh/ruff
- Licence: MIT (MIT License)
- Language: Rust. Stars: 51.6K. Forks: 2,830. Last push: Nov 30, 2026.
- Scan: safe, Nov 30, 2026, commit f36e197
Who it is for
Python developers, teams that want one code style everywhere, maintainers who want quick checks in CI, and anyone replacing Flake8, isort and Black. It runs on macOS, Linux and Windows; the VS Code extension and the browser playground need no terminal.
Getting started
1. No install: try it on your own code in the browser
https://play.ruff.rs2. Install with uv (or pip install ruff)
uv tool install ruff@latest3. Or with Homebrew
brew install ruff4. Check every Python file in the current folder
ruff check5. Fix what it can fix automatically
ruff check --fix6. Format your code in the Black style
ruff formatuv, pip and Homebrew install the ruff program and change nothing else. ruff check --fix and ruff format rewrite your files in place, so commit your work first. Ruff writes a .ruff_cache folder in each project to skip unchanged files, and settings go in a [tool.ruff] section of pyproject.toml or in ruff.toml. Our scan covers the source code, not the prebuilt binaries, the VS Code extension or the playground.
Safety scan
We cloned astral-sh/ruff at commit f36e197 on Nov 30, 2026 and ran the checks described on the GitHub Tools page: credential patterns, decode-and-execute code, install-time scripts, committed binaries, risky CI workflows, every host the code talks to, known vulnerabilities in pinned dependencies, and project hygiene. A person read every hit. This is what we found.
- 0 secret hits and no committed binaries across 11,343 files and about 1.38 million lines: Rust for the tools, plus Python test files and snapshots, many of them deliberately broken code for the rules to find.
- 2 pattern hits, both in crates/ruff_python_parser/src/string.rs at lines 922 and 930: tests that feed the parser a byte string holding every value from 0 to 255. The 5 Rust build scripts read the git commit for the version string, build a table of Unicode names and pack the bundled typeshed type files into the binary; none downloads anything.
- No install script in the repo. Releases are prebuilt binaries for macOS, Linux and Windows from the release workflows, which include a signing step, and are also published to PyPI. The standalone installer at astral.sh/ruff/install.sh adds ~/.local/bin to your PATH; Homebrew, Conda and most Linux distributions package it too.
- 10 advisories across 1,205 packages in 40 lockfiles, none critical or high. The 5 low ones are in DOMPurify in playground/package-lock.json, the code for play.ruff.rs, not the ruff program; the 5 unrated are notices that libraries such as paste are no longer maintained, and soundness bugs in crossbeam-epoch, rustix and url.
- Ruff contacts no server: there is no network code in the linter or formatter, and the hosts in the code are documentation links and rule examples. 27 workflows with no pull_request_target, including a daily fuzzing job for the parser; 108 of 175 third-party action uses are pinned to a commit. Renovate keeps dependencies current; no security policy file, CodeQL or OpenSSF Scorecard result.
What the scanner counted
| Check | Result |
|---|---|
| Secrets | None found. |
| Suspicious code | 2 pattern hits found and read; every one is listed under the raw findings. |
| Install-time code | 5 Cargo build scripts |
| Committed binaries | None. |
| CI workflows | 27 workflows. None use pull_request_target. 67 of 175 third-party actions pinned to a tag rather than a commit. |
| Network hosts | 40 distinct hosts referenced from source; most often github.com, docs.python.org, peps.python.org, docs.astral.sh. No URLs to bare IP addresses. |
| Known vulnerabilities | 10 advisories across 1,205 pinned packages: 0 critical, 0 high, 0 moderate, 5 low, 5 unrated. Cargo.lock: 552 packages, 5 advisories; crates/ty_completion_eval/truth/auto-import-includes-modules/uv.lock: 1 packages, 0 advisories; crates/ty_completion_eval/truth/auto-import-skips-current-module/uv.lock: 1 packages, 0 advisories; crates/ty_completion_eval/truth/auto-import-skips-third-party-tests/uv.lock: 6 packages, 0 advisories; crates/ty_completion_eval/truth/class-arg-completion/uv.lock: 1 packages, 0 advisories; crates/ty_completion_eval/truth/deprecated-deprioritized/uv.lock: 1 packages, 0 advisories; crates/ty_completion_eval/truth/exact-over-fuzzy/uv.lock: 1 packages, 0 advisories; crates/ty_completion_eval/truth/fstring-completions/uv.lock: 1 packages, 0 advisories; crates/ty_completion_eval/truth/higher-level-symbols-preferred/uv.lock: 1 packages, 0 advisories; crates/ty_completion_eval/truth/import-deprioritizes-dunder/uv.lock: 1 packages, 0 advisories; crates/ty_completion_eval/truth/import-deprioritizes-sunder/uv.lock: 1 packages, 0 advisories; crates/ty_completion_eval/truth/import-deprioritizes-type_check_only/uv.lock: 1 packages, 0 advisories; crates/ty_completion_eval/truth/import-keyword-completion/uv.lock: 1 packages, 0 advisories; crates/ty_completion_eval/truth/internal-typeshed-hidden/uv.lock: 1 packages, 0 advisories; crates/ty_completion_eval/truth/local-over-auto-import/uv.lock: 1 packages, 0 advisories; crates/ty_completion_eval/truth/modules-over-other-symbols/uv.lock: 1 packages, 0 advisories; crates/ty_completion_eval/truth/none-completion/uv.lock: 1 packages, 0 advisories; crates/ty_completion_eval/truth/numpy-array/uv.lock: 2 packages, 0 advisories; crates/ty_completion_eval/truth/object-attr-instance-methods/uv.lock: 1 packages, 0 advisories; crates/ty_completion_eval/truth/pass-keyword-completion/uv.lock: 1 packages, 0 advisories; crates/ty_completion_eval/truth/raise-uses-base-exception/uv.lock: 1 packages, 0 advisories; crates/ty_completion_eval/truth/scope-existing-over-new-import/uv.lock: 1 packages, 0 advisories; crates/ty_completion_eval/truth/scope-prioritize-closer/uv.lock: 1 packages, 0 advisories; crates/ty_completion_eval/truth/scope-simple-long-identifier/uv.lock: 1 packages, 0 advisories; crates/ty_completion_eval/truth/stdlib-over-third-party-same-name/uv.lock: 2 packages, 0 advisories; crates/ty_completion_eval/truth/tighter-over-looser-scope/uv.lock: 1 packages, 0 advisories; crates/ty_completion_eval/truth/tstring-completions/uv.lock: 1 packages, 0 advisories; crates/ty_completion_eval/truth/ty-extensions-lower-stdlib/uv.lock: 1 packages, 0 advisories; crates/ty_completion_eval/truth/typing-gets-priority/uv.lock: 1 packages, 0 advisories; crates/ty_completion_eval/truth/typing-only-auto-import-ranking/uv.lock: 1 packages, 0 advisories; fuzz/Cargo.lock: 281 packages, 2 advisories; playground/api/package-lock.json: 114 packages, 0 advisories; playground/deploy/package-lock.json: 91 packages, 0 advisories; playground/package-lock.json: 307 packages, 5 advisories; python/py-fuzzer/uv.lock: 17 packages, 0 advisories; python/ruff-ecosystem/uv.lock: 4 packages, 0 advisories; scripts/benchmarks/uv.lock: 21 packages, 0 advisories; scripts/ty_benchmark/package-lock.json: 2 packages, 0 advisories; scripts/ty_benchmark/uv.lock: 18 packages, 0 advisories; uv.lock: 86 packages, 0 advisories. |
| Project hygiene | Has automated dependency updates, licence file, contributing guide. Missing security policy, CodeQL. |
| OpenSSF Scorecard | Not scored: the project is not in Scorecard's weekly index. |
The raw findings
Every hit the scanner wrote out, with a link to the exact line at the scanned commit. Secrets candidates are redacted.
Pattern hits (2)
| Where | Rule | Match |
|---|---|---|
| crates/ruff_python_parser/src/string.rs:922 | long-hex-escape-run | let source = r##"b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !"#$%&\'()*+,-./01… |
| crates/ruff_python_parser/src/string.rs:930 | long-hex-escape-run | let source = r##"b"\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !\"#$%&'()*+,-./01… |
Worst known vulnerabilities (10 of 10)
| Advisory | Severity | Package | Summary |
|---|---|---|---|
| GHSA-6688-9rhm-gjv2 | low | dompurify@3.4.15 | DOMPurify: IN_PLACE returns a force-removed rawtext root whose text carries attacker markup - pure HTML reparse executes |
| GHSA-c6gr-qvv4-5v3f | low | dompurify@3.4.15 | DOMPurify: SMIL attributeName=href guard is skipped when PARSER_MEDIA_TYPE is application/xhtml+xml |
| GHSA-cg2g-xh64-v4q7 | low | dompurify@3.4.15 | DOMPurify SAFE_FOR_TEMPLATES bypass: split template expressions survive in attached shadow root content on DOM output mo… |
| GHSA-mrv2-3pqr-j5jr | low | dompurify@3.4.15 | DOMPurify IN_PLACE: hook that removes a parent or sibling leaves the detached subtree's event handlers armed (incomplete… |
| GHSA-p98j-92pf-mc4p | low | dompurify@3.4.15 | DOMPurify: IN_PLACE: node-removing afterSanitize hook leaves detached subtree event handlers armed, causing DOM XSS |
| RUSTSEC-2026-0204 | unknown | crossbeam-epoch@0.9.18 | Invalid pointer dereference in `fmt::Pointer` impl for `Atomic` and `Shared` when the underlying pointer is invalid |
| RUSTSEC-2024-0436 | unknown | paste@1.0.15 | paste - no longer maintained |
| RUSTSEC-2026-0173 | unknown | proc-macro-error2@2.0.1 | proc-macro-error2 is unmaintained |
| GHSA-jh2m-fhpj-3vr7 | unknown | rustix@1.1.5 | xattr functions mark unwritten bytes as initialized when given a zero-length buffer |
| GHSA-hrj5-67jp-wqp9 | unknown | url@2.5.8 | Stack overflow in `Url::origin()` on nested `blob:` URLs |
By the numbers
| Stars | 51.6K |
|---|---|
| Forks | 2,830 |
| Contributors | 1,034 |
| Commits | 18.6K |
| Open issues | 1,745 |
| Open pull requests | 569 |
| Releases | 437 |
| Latest release | 0.17.6 |
| Licence | MIT |
| Main language | Rust |
| Project age | 4 years |
| Last push | Nov 30, 2026 |
| Tracked files | 11,343 |
| Lines of code | 1.4M |
| Checkout size | 97 MB |
Lines by language: Rust 878.3K, Markdown 333.7K, Python 132.2K, JSON 9,527, TypeScript 7,354, YAML 7,052.
Questions
Is Ruff free?
Yes. It is free and open source under the MIT licence, with no account and no paid version. The VS Code extension and the playground are free too.
Ruff or Black and Flake8?
Ruff can replace both: ruff format matches Black's style almost exactly, and ruff check covers Flake8, many of its plugins, isort and pyupgrade, much faster. Keep an older tool only for a plugin Ruff has not rebuilt.
Can I use Ruff in VS Code?
Yes. Install the official Ruff extension from Astral, which ships its own copy of Ruff; it shows problems as you type and can fix and format on save.
Can I try Ruff without installing it?
Yes. play.ruff.rs, the project's own playground, runs Ruff on code you paste into your browser and shows the fixes and formatting.
How do I uninstall Ruff?
Run uv tool uninstall ruff, pip uninstall ruff or brew uninstall ruff, whichever you used, then delete the .ruff_cache folders in your projects if you like.
This post is part of GitHub Tools, where every repository is cloned and scanned before it is written up. The scan is a snapshot of one commit on one day; the repository has moved on since, so check it before you install.
