Ruff v0.16.0 – Significant new updates – 413 default rules up from 59
Ruff v0.16.0: Major Update — Default Rules Jump from 59 to 413
Published: July 23, 2026 | Author: Brent Westbrook (@ntBre)
Ruff v0.16.0 has officially arrived! You can grab the latest version via PyPI or utilize your preferred package manager:
uv tool install ruff@latest
Quick Reminder: Ruff is a high-performance Python linter and formatter crafted in Rust. It is designed to be a drop-in replacement for
Black,Flake8(and its various plugins),isort,pydocstyle, andpyupgrade, often running orders of magnitude faster than these tools combined.
🛠️ Migrating to v0.16
Updating to this version is straightforward. While there are a few breaking changes, they are minimal, meaning most developers can upgrade without needing to overhaul their existing configurations or source code.
- Update Ruff to v0.16.0
- Review new default rule warnings
- Test Markdown formatting in documentation
📈 An Enhanced Default Rule Set
One of the most significant shifts in v0.16 is the expansion of the default rule set. Ruff now enables 413 rules by default, a massive increase from the previous 59.
Rule Growth Comparison
The total library of available rules has expanded significantly since v0.1.0:
| Version | Default Rules Enabled | Total Rules Available |
|---|---|---|
| v0.1.0 | 59 | 708 |
| v0.16.0 | 413 | 968 |
The growth in total rules can be expressed as:
Many of these newly enabled rules target critical issues, such as immediate runtime errors and syntax mistakes, which previously required manual activation. Even if you utilize select or extend-select in your config, these defaults may introduce you to highly useful rules you hadn't yet discovered.
Key Highlights:
- B: Rules from
flake8-bugbear. - UP: Rules from
pyupgrade. - RUF: Ruff's own internal rule category.
If the new defaults are too noisy for your project, you can revert to the legacy set using this configuration:
[lint]
select = ["E4", "E7", "E9", "F"]
Note: This update is a stepping stone toward our broader goal of rule recategorization.
✨ New Features in v0.16
📝 Markdown Code Block Formatting
Ruff can now format Python snippets embedded within Markdown files. It targets fenced blocks using the following info strings: python, py, python3, py3, pyi, or pycon.
pyiblocks Formatted as stub files.pyconblocks Formatted as REPL sessions.- Others Standard Python formatting.
Example:
In a README.md file:
import ruff
ruff_binary = (
ruff.find_ruff_bin()
)
Running ruff format will now clean up the above block. This also extends to Quarto notebooks (e.g., .qmd files), provided your extension mapping is correctly configured.
How to suppress formatting:
- Inline: Use
# fmt: offand# fmt: oninside the block. - Regional: Use HTML comments:
<!-- fmt: off -->
<!-- fmt: on -->x = "This won't be touched" - Global: Add
*.mdto yourextend-excludesetting.
🚫 Advanced Suppression with ruff: ignore
Ruff introduces a new, dedicated suppression comment format. While v0.15 introduced range suppression via ruff: disable and ruff: enable, v0.16 adds more granularity.
ruff: ignore: Suppresses a diagnostic on the current line (likenoqa) or the following logical line (e.g., a function header spanning multiple lines).ruff: file-ignore: Disables specific diagnostics for the entire file.
Example with reasons:
# ruff: file-ignore[F401] Allow unused imports for API stability
import foo
import bar
# ruff: ignore[N803]
def legacy_Function_Name():
pass
Pro Tip: Use the --add-ignore CLI flag to insert these automatically. In --preview mode, you can use rule names instead of codes:
❯ uvx ruff@latest check --preview --add-ignore try.py
# Result: import math # ruff: ignore[unused-import]
🔍 Fixes Integrated into Output
The check and format --check commands now display the actual diff of proposed fixes directly within the diagnostic output, appearing immediately below the help text.
Previously, you had to use the --diff flag, which often hid the explanatory diagnostics. Now, you get both.
Example Workflow: If you have:
if True: pass
elif False: pass
Running format --check will now show the exact transformation required. Furthermore, format --check now supports all the output formats available to the linter, including:
JSON(for machine reading)GitHub/GitLab(for CI annotations)
One final note on output formats...