Skip to content
CAI
Software that uses CAICheck a score

astral-sh/ruff

61.4

Adequate · 14 November 2026

728.1k

lines of production code

Rust

primary language

5

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Features

Add Tryceratops linting rules to Ruff

Ruff now includes the Tryceratops rule set, enabling checks for Python exception handling best practices. This adds support for rules such as TRY002 (RaiseVanillaClass), TRY003 (RaiseVanillaArgs), TRY004 (TypeCheckWithoutTypeError), TRY201 (VerboseRaise), TRY203 (UselessTryExcept), TRY300 (TryConsiderElse), TRY301 (RaiseWithinTry), TRY400 (ErrorInsteadOfException), and TRY401 (VerboseLogMessage). The implementation includes helper logic to detect logging calls within try/except blocks to support these diagnostics.

_crates/ruff\_linter/src/rules/pandas\_vet, crates/ruff\linter/src/rules/tryceratops · high confidence

Add VS Code Dev Container support for Rust development

Developers can now open the project in VS Code Dev Containers or GitHub Codespaces with a pre-configured environment. The setup uses the official Rust dev container image, mounts a persistent volume for Cargo cache to speed up builds, and installs essential tools including clippy, rustfmt, cargo-insta, maturin, and prek. It also configures VS Code extensions for Python, Rust Analyzer, TOML editing, and testing.

.devcontainer · high confidence

Add \`ty\_completion\_bench\` CLI tool for ad hoc completion benchmarking

A new command-line utility, \ty\_completion\_bench\, has been added to allow developers to benchmark and profile the performance of \ty\'s code-completion features. The tool accepts a Python file path and a byte offset to simulate a cursor position, automatically discovering the project directory via \pyproject.toml\ and running \uv sync\ to ensure dependencies are installed. It measures the latency of the initial completion request and, optionally, repeated requests to assess caching behavior, outputting timing metrics and the list of suggested completions.

_crates/ty\_completion\bench · high confidence

Add configuration for ignoring variadic arguments in flake8-unused-arguments rules

The flake8-unused-arguments rules (UnusedFunctionArgument, UnusedMethodArgument, UnusedClassMethodArgument, UnusedStaticMethodArgument, and UnusedLambdaArgument) now support a new \ignore\_variadic\_names\ setting. When enabled, the linter will suppress warnings for unused variadic arguments (like \args and \\*kwargs), allowing users to customize whether these common Python patterns trigger lint errors.

_crates/ruff\_linter/src/rules/flake8\_unused\arguments · high confidence

Add configuration to allow or disallow multiline implicit string concatenation

Users can now control whether the linter flags implicit string concatenation across multiple lines by setting \allow\_multiline\ in the \flake8\_implicit\_str\_concat\ configuration. When set to \false\, multiline implicit concatenations will be reported as violations, providing finer control over style enforcement for this rule set.

_crates/ruff\_linter/src/rules/flake8\_implicit\_str\concat · high confidence

Add flake8-debugger and flake8-print rule modules

The linter now includes dedicated modules for the flake8-debugger and flake8-print rule sets. This change introduces the \flake8\_debugger\ module, which defines the \DebuggerUsingType\ enum to distinguish between debugger calls and imports, and the \flake8\_print\ module, which handles print-related diagnostics. Both modules include test suites that verify the \Debugger\, \Print\, and \PPrint\ rules against their respective test fixtures using the new \LinterSettings\ configuration.

_crates/ruff\_linter/src/rules/flake8\_debugger, crates/ruff\_linter/src/rules/flake8\print · high confidence

Add flake8-no-pep420 linter rule for implicit namespace packages

The linter now includes the \flake8-no-pep420\ rule set, which detects files that are missing an \\_\init\\_.py\ file and are not part of an explicit namespace package. This helps enforce proper Python package structure by identifying implicit namespace packages. The implementation includes test cases for various scenarios, including empty and non-empty directories, scripts with shebangs, PEP 723 scripts, and explicit namespace packages.

_crates/ruff\_linter/src/rules/flake8\_no\pep420 · high confidence

Add flynt linter rules for converting static strings to f-strings

The linter now includes rules from the flynt library, enabling detection of static string concatenations and format calls that can be converted to f-strings. This change introduces the \StaticJoinToFString\ rule (FLY002) and associated helper logic to identify safe conversions, such as simple calls and literal expressions, allowing users to automatically modernize string formatting in their code.

_crates/ruff\linter/src/rules/flynt · high confidence

Add fuzz testing harnesses for Ruff

Introduces a new fuzzing infrastructure in the \fuzz/\ directory to automatically detect crashes, panics, and correctness issues in Ruff's parser, formatter, linter, and type checker. This includes five specific fuzz targets: \ruff\_parse\_simple\ for basic parse/unparse stability, \ruff\_parse\_idempotency\ to ensure consistent parsing results, \ruff\_formatter\_idempotency\ and \ruff\_formatter\_validity\ to verify the formatter does not introduce new errors or change output on re-formatting, \ruff\_fix\_validity\ to ensure fixes do not introduce new linter errors, and \ty\_check\_invalid\_syntax\ to prevent the type checker from panicking on invalid syntax. An initialization script (\init-fuzzer.sh\) and documentation are provided to set up the corpus and run the fuzzers.

fuzz · high confidence

Add scripts for generating new plugins and rules

New \scripts/add\_plugin.py\ and \scripts/add\_rule.py\ scripts are introduced to automate the creation of boilerplate for new linter plugins and individual rules. These scripts generate the necessary directory structures, module files, test fixtures, and registry entries, streamlining the process of extending Ruff's linting capabilities.

scripts · high confidence

Added fix support for manual list and dict comprehensions

The perflint rules for manual list comprehensions (PERF401) and manual dict comprehensions (PERF403) now provide automatic fixes. This change introduces helper logic to correctly handle statement deletion ranges, including preserving comments and managing semicolons when multiple statements appear on a single line, allowing users to automatically refactor inefficient list and dictionary construction patterns.

_crates/ruff\linter/src/rules/perflint · high confidence

Added shebang comment parsing logic

The linter now includes a new \shebang\ module under \crates/ruff\_linter/src/comments\ that can detect and parse shebang directives (e.g., \\#!/usr/bin/env python3\) at the start of a file. This addition provides the underlying capability to identify shebang lines, which is a prerequisite for handling \noqa\ directives on shebang lines as indicated by the commit message regarding \noqa\ shebang handling.

_crates/ruff\linter/src/comments · medium confidence

Auto-fix for f-string logging calls (G004) in preview mode

Ruff now provides an automatic fix for the G004 rule (logging uses f-strings) when the \fix\_f\_string\_logging\ preview feature is enabled. The linter detects logging calls that use f-strings with simple positional arguments and converts them to percent-style formatting (e.g., \`f

_crates/ruff\_linter/src/rules/flake8\_logging\format/rules · high confidence

Automatic removal of print and pprint statements

The linter now provides an unsafe automatic fix for T201 (print) and T203 (pprint) violations that removes the offending statement entirely when it appears as a standalone expression. This fix is marked unsafe because it may delete print calls used for legitimate command-line output or other non-debugging purposes. Calls with non-default output targets (e.g., \file=sys.stdout\ or \stream=sys.stderr\) are excluded from triggering the rule and thus do not receive the fix.

_crates/ruff\_linter/src/rules/flake8\print/rules · high confidence

Benchmark infrastructure for real-world projects and criterion compatibility

The benchmarking module now includes infrastructure to benchmark real-world Python projects by cloning specific repository commits, installing dependencies via uv, and optionally copying project files to a memory file system to reduce I/O noise. It also introduces a compatibility layer that switches the underlying benchmarking backend between \criterion\ and \codspeed\_criterion\_compat\ depending on build configuration, ensuring consistent benchmark execution across different environments.

_crates/ruff\benchmark/src · high confidence

Detect f-strings, format calls, and printf-style formatting in gettext arguments

The flake8-gettext linter now flags three patterns that break translation lookups: f-strings (INT001), str.format() calls (INT002), and printf-style % formatting (INT003) passed directly to gettext functions like \_() or ngettext(). In each case, the formatted string is resolved before the lookup, so the catalog searches for the rendered text instead of the template. The rules also check the plural argument of ngettext() and recommend formatting the returned string instead. This helps prevent broken or missing translations in internationalized code.

_crates/ruff\_linter/src/rules/flake8\gettext/rules · high confidence

Detect implicit namespace packages and flag missing \_\_init\_\_.py files

The linter now includes the INP001 rule to identify directories that function as implicit namespace packages (PEP 420) but lack an \_\init\\.py file. This check helps users catch potential packaging oversights by flagging files that are part of such packages, while intelligently ignoring non-Python files, files in the project root or source directories, and scripts containing shebangs or PEP 723 tags. When nested roots are allowed, it also identifies intermediary packages missing their \\init\\_.py.

_crates/ruff\_linter/src/rules/flake8\_no\pep420/rules · high confidence

Enforce import conventions with new ICN002 and ICN003 rules

The linter now includes two new rules under the flake8-import-conventions plugin: ICN002 (BannedImportAlias) flags imports using non-standard aliases (e.g., \import tensorflow.keras.backend as K\) that violate PEP 8, and ICN003 (BannedImportFrom) flags explicit member imports (e.g., \from pandas import Series\) that should instead be accessed via the module alias. These rules allow users to enforce consistent import styles and avoid specific aliases or member imports via configuration options.

_crates/ruff\_linter/src/rules/flake8\_import\conventions/rules · high confidence

Expanded Airflow linting rules and migration helpers for Airflow 3 compatibility

Ruff now includes a comprehensive set of Airflow-specific linting rules (AIR001–AIR321) to help users migrate to Airflow 3. These rules detect deprecated imports, renamed classes, and changed function signatures, and provide auto-fixes for many common issues. New checks include AIR003 and AIR004 for detecting Variable.get() calls outside task execution context and improper use of task branching as short-circuiting, respectively. The AIR2xx series flags XCom pull usage in template strings and implicit multiple outputs. The AIR3xx series covers removals (AIR301), provider moves (AIR302), incompatible function signatures (AIR303), and dynamic DAG values (AIR304), with specific rules for Airflow 3.1 changes (AIR321). The implementation includes helper utilities to manage replacements, auto-imports, and try-except guarded deprecations, ensuring smoother upgrades.

_crates/ruff\linter/src/rules/airflow · high confidence

Format Python code blocks inside Markdown files

The new \ruff\_markdown\ crate enables automatic formatting of Python code blocks embedded in Markdown documents. When processing a Markdown file, Ruff now detects fenced code blocks with Python-related language markers (such as \python\, \py\, \py3\, \pyi\, or \pycon\) and applies the configured Python formatter to their contents. This allows users to maintain consistent code style within documentation and Jupyter-style notebooks directly through Ruff's formatting pipeline.

_crates/ruff\markdown · high confidence

Implement BLE001 blind-except rule with logging and re-raise exemptions

The \flake8-blind-except\ rule (BLE001) is now implemented to flag \except\ clauses that catch \BaseException\ or \Exception\ without narrowing the scope. To reduce false positives, the rule exempts blocks where the exception is re-raised (e.g., \raise\ or \raise e\) or logged with \exc\_info\ enabled (e.g., \logging.exception(...)\). This allows users to safely catch broad exceptions when they are properly handled or propagated.

_crates/ruff\_linter/src/rules/flake8\_blind\except/rules · high confidence

Initial release of ty, a fast Python type checker

This change introduces the \ty\ project, a new Python type checker written in Rust. The \crates/ty\ location contains the command-line interface (CLI) implementation, including argument parsing, logging, and output formatting, as well as the initial documentation (CONTRIBUTING.md, README.md, and environment/tracing docs). The CLI supports commands like \check\, \server\, \version\, and \explain\, and integrates with the underlying type-checking engine in \ty\_python\_semantic\.

crates/ty · high confidence

Initial support for Jupyter Notebook parsing and linting

Ruff now reads and lints Jupyter Notebook files (\.ipynb\). The \ruff\_notebook\ crate provides the underlying logic to parse notebook JSON, map line/column positions from concatenated cell sources back to individual cells, and handle notebook-specific features such as cell magics, VS Code language identifiers, and missing cell IDs in older notebook formats.

_crates/ruff\notebook · high confidence

Introduce LSP-based diagnostic benchmarks for ty

The \ty\_benchmark\ script now includes a new LSP benchmarking mode that measures diagnostic response times for \ty\ (alongside Pyright and Pyrefly) by launching their language servers and using a custom LSP client to time initial and incremental diagnostics. This adds the \lsp\_client.py\ module, LSP-specific test fixtures in \test\_lsp\_diagnostics.py\, and updates the project definitions and tool wrappers to support server-based benchmarking alongside the existing CLI-based checks.

_scripts/ty\benchmark · high confidence

Introduce NumPy 2.0 migration rules

Added new linting rules (NPY001, NPY002, NPY003, and NPY201) to detect deprecated NumPy types, legacy random functions, deprecated functions, and general NumPy 2.0 deprecations. This includes helper utilities for searching imports and attributes in the AST to support these checks, enabling users to identify code that needs updating for NumPy 2.0 compatibility.

_crates/ruff\linter/src/rules/numpy · high confidence

Introduce \`ty\_combine\` crate for configuration merging

The new \ty\_combine\ crate provides the \Combine\ trait and its implementations, enabling the merging of configuration values from multiple sources (such as CLI arguments, config files, and environment variables). This logic follows a precedence model where higher-priority values override lower-priority ones, with specific handling for arrays and maps to ensure intuitive overriding behavior (e.g., later patterns in exclusion lists override earlier ones). This change introduces a new internal component for Ruff 0.17.0 rather than altering existing user-facing behavior directly.

_crates/ty\combine · high confidence

Introduce auto-return-type inference for flake8-annotations rules

The flake8-annotations linter now automatically infers return types for functions that lack explicit annotations. By analyzing return statements and control flow (including implicit returns and exception handling), the linter can suggest appropriate type hints, using \Never\ (or \NoReturn\ for older Python versions) for functions that always raise, and \Optional\ or union types for functions with multiple return paths. This capability is implemented in the new \helpers.rs\ module and integrated into the existing return-type checking rules (ANN201, ANN202, etc.), enhancing the linter's ability to guide users toward complete type annotations.

_crates/ruff\_linter/src/rules/flake8\annotations · high confidence

Introduce completion evaluation framework for ty

Added a new \ty\_completion\_eval\ crate that provides a command-line tool and infrastructure for evaluating the ranking quality of ty's LSP completion suggestions. The framework uses a Mean Reciprocal Rank (MRR) metric against a set of truth data files (located in \truth/\) to measure how well completions are ordered. It includes a CLI for running all tasks or debugging specific ones, and is integrated into CI to fail if the MRR drops below a threshold, ensuring completion ranking improvements are tracked and regressions are caught.

_crates/ty\_completion\eval · high confidence

Introduce configurable unparsing mode for code generation

The \ruff\_python\_codegen\ crate now supports a configurable \Mode\ for its \Generator\, allowing users to choose between Ruff's default unparsing behavior and a mode that mimics Python's standard \ast.unparse\ output (which always uses single quotes). This change also introduces a \round\_trip\ helper function to easily parse and regenerate Python source code while preserving stylistic details like indentation and line endings.

_crates/ruff\_python\codegen · high confidence

Introduce flake8-bandit configuration settings

The flake8-bandit rules now support configurable options via a new \Settings\ struct. Users can customize the \hardcoded\_tmp\_directory\ list to extend the default trusted temporary directories (S108), enable \check\_typed\_exception\ to refine exception handling checks (S110), and configure \extend\_markup\_names\ and \allowed\_markup\_calls\ to control markup safety warnings (S704).

_crates/ruff\_linter/src/rules/flake8\bandit · high confidence

Introduce flake8-bugbear plugin with helper utilities and configurable immutable calls

The \flake8-bugbear\ linter plugin is now available in \crates/ruff\_linter/src/rules/flake8\_bugbear\, providing a set of helper functions and rule definitions. The new \helpers.rs\ module adds utilities to detect infinite iterators (such as \itertools.cycle\, \count\, and \repeat\) and to identify the last top-level expression in a Jupyter Notebook cell, which supports rules like B015 and B018. The plugin includes a \Settings\ struct that allows users to configure \extend\_immutable\_calls\, enabling custom types to be treated as immutable for rules B006 and B008. The module also registers a comprehensive suite of tests for various bugbear rules, ensuring the linter can detect issues like mutable default arguments, duplicate exception handlers, and loop variable overrides.

_crates/ruff\_linter/src/rules/flake8\bugbear · high confidence

Introduce flake8-datetimez lint rules for naive datetime usage

This change adds the \flake8-datetimez\ rule set to Ruff, providing linters that detect the use of naive (non-timezone-aware) datetime objects. The new rules cover \datetime.datetime.now()\, \utcnow()\, \today()\, \fromtimestamp()\, \strptime()\, and \datetime()\ constructors when called without explicit timezone information, as well as \datetime.date.today()\ and \date.fromtimestamp()\. It also flags the use of \datetime.datetime.min\ and \datetime.datetime.max\ which are inherently naive. These rules help prevent subtle bugs related to timezone handling by encouraging the use of timezone-aware alternatives like \datetime.now(tz=...)\ or \.replace(tzinfo=...)\.

_crates/ruff\_linter/src/rules/flake8\datetimez/rules · high confidence

Introduce flake8-django rule set and expand ruff plugin helpers

This change adds a new \flake8\_django\ rule module with helper functions to identify Django models, model forms, and model fields, along with the corresponding test suite for rules like DJ001 and DJ008. In the \ruff\ plugin, the \helpers.rs\ module is expanded to provide robust detection for both stdlib \dataclasses\ and third-party \attrs\ dataclasses (including \auto\_attribs\ logic and frozen status), while \typing.rs\ is updated to treat \typing\_extensions\ members as standard typing aliases and improve type resolution for unions and literals.

_crates/ruff\linter/src/rules/ruff · high confidence

Introduce flake8-logging-format linting rules

Added the \flake8-logging-format\ rule set to the linter, introducing checks for inefficient logging practices such as using \str.format\ (G001), \%\-style formatting (G002), and string concatenation (G003) in logging calls. The implementation includes violation definitions, test cases for standard and preview modes, and configuration support for custom logger objects via \lint.logger-objects\.

_crates/ruff\_linter/src/rules/flake8\_logging\format · high confidence

Introduce flake8-return lint rules for return statement analysis

Added the \flake8\_return\ rule set to the linter, introducing checks for redundant or implicit return statements. This includes \RET501\ (UnnecessaryReturnNone) to flag explicit \return None\ when it is the only possible return value, \RET502\ (ImplicitReturnValue) to suggest adding explicit \None\ returns for clarity, \RET503\ (ImplicitReturn) to require explicit returns at the end of functions that can return non-None values, and \RET504\ (UnnecessaryAssign) to simplify assignments immediately preceding a return. The implementation includes automatic fixes for these violations, with safety markers applied where comments might be affected.

_crates/ruff\_linter/src/rules/flake8\return/rules · high confidence

Introduce flake8-self linter with configurable ignore names

Added the \flake8-self\ plugin to enforce private member access rules (SLF001). The linter now includes a settings module that allows users to configure a list of names to ignore, defaulting to common namedtuple and Enum attributes like \\_make\, \\_asdict\, and \\_fields\. This change also adds corresponding test coverage for the new rule and its configuration options.

_crates/ruff\_linter/src/rules/flake8\self · high confidence

Introduce flake8-todos linting rules for Python TODO comments

Added a new set of linter rules under the \flake8\_todos\ module to enforce consistent formatting and completeness of TODO comments in Python code. These rules check for valid tags (flagging FIXME/XXX as invalid), require an author name, mandate an associated issue link or code, require a colon after the tag, demand a description, and enforce uppercase capitalization. This provides users with automated guidance to make TODOs more actionable and discoverable.

_crates/ruff\_linter/src/rules/flake8\todos/rules · high confidence

Introduce flake8-unused-arguments lint rules

Added the \flake8\_unused\_arguments\ rule set to detect unused function, method, class method, and static method arguments. The implementation defines specific violation types (\UnusedFunctionArgument\, \UnusedMethodArgument\, etc.) and exempts methods decorated with \@typing.override\ to prevent conflicts with type checkers regarding the Liskov Substitution Principle.

_crates/ruff\_linter/src/rules/flake8\_unused\arguments/rules · high confidence

Introduce flake8-use-pathlib linter rules

Added the \flake8-use-pathlib\ rule set to the linter, providing checks that recommend replacing \os\ and \os.path\ functions with \pathlib\ equivalents (e.g., \os.listdir\ to \Path.iterdir\, \os.path.join\ to \Path.joinpath\). The implementation includes helper utilities for path analysis, violation definitions with autofix capabilities, and comprehensive test coverage for the new rules.

_crates/ruff\_linter/src/rules/flake8\_use\pathlib · high confidence

Introduce internal \`ruff\_ranged\_value\` crate for tracking configuration sources

Ruff now includes a new internal crate, \ruff\_ranged\_value\, which provides the \RangedValue\<T\>\ type to wrap configuration values with their origin (file, CLI, editor, or script metadata) and byte range. This enables the tool to accurately report the source of settings and error spans, particularly for PEP 723 script metadata and inline configuration, improving the precision of diagnostics and configuration resolution.

_crates/ruff\_ranged\value · high confidence

Introduce internal crate for accurate heap memory tracking

The new \ruff\_memory\_usage\ crate provides an internal API for measuring heap memory usage while avoiding double-counting of shared objects. It exposes a \heap\_size\ function that utilizes a thread-local \StandardTracker\ to track memory consumption accurately, supporting the broader memory profiling capabilities within Ruff.

_crates/ruff\_memory\usage · high confidence

Introduce mdtest crate for markdown-based integration tests

The new \crates/mdtest\ crate provides a framework for running integration tests defined in Markdown files, allowing embedded Python and TOML code blocks to be executed and validated against expected diagnostic assertions (such as \\# error:\ and \\# revealed:\). It supports inline comments for assertions, groups diagnostics by line number for accurate matching, and offers configurable output formats including GitHub Actions annotations for CI integration.

crates/mdtest · high confidence

Introduce mdtest framework for Ruff linting tests

Added a new \ruff\_mdtest\ crate that enables writing Ruff linter tests as Markdown files with embedded code blocks. This framework supports testing Python, Python stub, Jupyter notebook, and TOML files, allowing developers to define test cases and expected diagnostics directly within Markdown fixtures using a structured format.

_crates/ruff\mdtest · high confidence

Introduce native \`ruff server\` with notebook and document editing support

The \ruff\_server\ crate now provides the core implementation for the native Ruff Language Server, replacing the previous \ruff-lsp\ integration. This change introduces a new architecture using a lock-free data model and an event loop to handle LSP requests, supporting real-time diagnostics, formatting, and code actions. It adds comprehensive support for Jupyter Notebooks, including cell-level editing, synchronization, and diagnostics, as well as handling of standard text documents with proper version tracking and encoding conversion. The server also includes configuration resolution, workspace management, and test fixtures for validating these new capabilities.

_crates/ruff\server · high confidence

Introduce new CLI subcommands for analysis, configuration, and rule documentation

The \ruff\ CLI now includes several new subcommands: \ruff analyze graph\ generates import dependency graphs for Python files (including Jupyter notebooks), \ruff config\ displays configuration options in text or JSON format, \ruff rule\ and \ruff rules\ provide detailed documentation for specific or all linting rules, and \ruff completions\ enables tab-completion for configuration keys. These additions expand the tool's capabilities for project introspection, configuration management, and developer assistance.

crates/ruff/src/commands · high confidence

Introduce py-fuzzer and ruff-ecosystem as standalone Python packages

The repository now includes two new standalone Python packages: \py-fuzzer\, a tool for running Ruff executables on randomly generated Python source code to detect panics and parser errors, and \ruff-ecosystem\, a tool for comparing lint and format results between two Ruff versions across a corpus of real-world open-source projects. Both packages are now installable via \uv\ and include their own documentation, configuration, and lockfiles.

python · high confidence

Introduce pydoclint plugin with configuration for one-line docstrings

A new \pydoclint\ plugin is added to the linter, providing rules that validate docstrings against the style conventions of the \pydocstyle\ plugin (Google, NumPy, etc.). This location introduces the plugin's test harness and configuration settings, specifically adding an \ignore\_one\_line\_docstrings\ option that allows users to suppress linting errors for single-line docstrings.

_crates/ruff\linter/src/rules/pydoclint · high confidence

Introduce ruff\_db as the foundational database and system abstraction layer

This change introduces the \ruff\_db\ crate, establishing the core database infrastructure for Ruff's type checking and analysis engine. It defines the \Db\ trait and \Files\ system for managing file paths, revisions, and durability within the Salsa incremental computation framework, alongside a \System\ trait that abstracts file system operations (including a \VendoredFileSystem\ for bundled typeshed stubs) to support CLI, LSP, and WASM environments. The module also provides essential utilities for cancellation tokens, panic capture with backtraces, source text handling (including Jupyter notebooks), and AST parsing, forming the base layer upon which semantic analysis and type checking are built.

_crates/ruff\db/src · high confidence

Introduce ruff\_diagnostics crate with Edit, Fix, and SourceMap types

The new \ruff\_diagnostics\ crate provides the core types for handling code fixes and diagnostics. It introduces the \Edit\ struct to represent individual text modifications (insertions, deletions, or replacements) and the \Fix\ struct to group multiple edits together with an \Applicability\ level (\Safe\, \Unsafe\, or \DisplayOnly\) and an \IsolationLevel\ to manage overlapping changes. Additionally, it includes a \SourceMap\ to track position mappings between original and transformed source code, enabling accurate error reporting after fixes are applied.

_crates/ruff\diagnostics/src · high confidence

Introduce ruff\_index crate for type-safe indexed collections

The new \ruff\_index\ crate provides type-safe, newtype-wrapped index collections (\IndexVec\, \IndexSlice\, \FrozenIndexVec\) and an \Idx\ trait, replacing raw \usize\ indexing with distinct index types. This change improves memory safety and code clarity by ensuring that indices are only used with their intended collections, supporting features like Salsa integration and arena allocation within the Ruff codebase.

_crates/ruff\index/src · high confidence

Introduce ruff\_python\_index crate for source code indexing

A new internal crate, ruff\_python\_index, has been added to efficiently track non-AST elements in Python source files. This component indexes the locations of comments, multiline strings, and interpolated strings (f-strings and t-strings), as well as line continuations. By providing precise ranges for these elements, it enables token-based rules and suppression comments to correctly handle code structures that are otherwise omitted from the abstract syntax tree.

_crates/ruff\_python\index · high confidence

Introduce ruff\_python\_literal crate for Python string literal handling

The new \ruff\_python\_literal\ crate provides the internal Rust implementation for parsing and formatting Python string literals, including printf-style (\%\) formatting, f-string specifications, and character escaping. This module handles the conversion of Python string representations (such as \repr\ and \str\) into their escaped forms, manages format specifiers for both old-style and new-style formatting, and ensures correct Unicode handling for display and normalization.

_crates/ruff\_python\literal · high confidence

Introduce ruff\_python\_trivia crate for Python source trivia handling

The new \ruff\_python\_trivia\ crate consolidates internal utilities for parsing and analyzing Python source trivia, including comment ranges, pragma detection, whitespace handling, and tokenization. It provides \CommentRanges\ for indexing and querying comments, \SuppressionKind\ for identifying formatter suppression directives (\fmt: on/off/skip\), and \NameMatcher\ for efficient identifier and keyword pre-filtering with NFKC normalization support. The crate also includes a \SimpleTokenizer\ for lexical analysis, a \Cursor\ for string traversal, and textwrap functions for indentation management, serving as a foundational component for Ruff 0.17.0's formatting and linting logic.

_crates/ruff\_python\trivia · high confidence

Introduce ruff\_source\_file crate for source location and line indexing

Ruff now includes a new internal \ruff\_source\_file\ crate that centralizes source file management, line indexing, and newline handling. This change introduces \SourceFile\ and \SourceCode\ types to manage file names and text, alongside a \LineIndex\ for efficient byte-offset-to-line-column conversions (including UTF-8 BOM handling). It also provides utilities like \UniversalNewlineIterator\ for consistent line iteration across LF, CRLF, and CR endings, and \LineRanges\ for computing line boundaries. This refactoring extracts these capabilities from previous locations to support more robust source code analysis and diagnostic reporting.

_crates/ruff\_source\file · high confidence

Introduce ruff\_text\_size crate for type-safe text offsets and ranges

The new \ruff\_text\_size\ crate provides \TextSize\ (a 32-bit UTF-8 byte offset) and \TextRange\ (start/end offsets) to replace raw integers for text indexing, reducing storage and preventing invalid ranges. It includes serialization support via \serde\ (serializing \TextSize\ as a \u32\ and \TextRange\ as a tuple) and JSON schema generation via \schemars\ for configuration tooling, along with traits like \TextLen\ and \Ranged\ to integrate with Ruff's source text handling.

_crates/ruff\_text\size · high confidence

Introduce the Ruff WASM API for browser-based linting and formatting

This change adds the \ruff\_wasm\ crate, exposing a WebAssembly API that allows Python linting and formatting to run directly in browser environments. The API provides a \Workspace\ class for configuring settings (such as line length, indent width, and rule selection) and methods to check code for diagnostics and format source text. Diagnostics are returned with detailed location information, fix suggestions, and sub-diagnostics, enabling rich error reporting in web-based tools like the Ruff playground.

_crates/ruff\wasm · high confidence

Introduce the \`ruff\_formatter\` code formatting crate

Adds the \ruff\_formatter\ crate, providing a language-agnostic infrastructure for formatting source code. This includes a new intermediate representation (\FormatElement\) for formatting documents, a \Buffer\ trait for writing formatted output, and a suite of builder functions (such as \soft\_line\_break\, \group\, and \best\_fitting\) to construct the formatting IR. The crate also exposes formatting macros (\format!\, \write!\, \format\_args!\) and configuration types like \IndentStyle\ and \LineWidth\ to control how code is rendered.

_crates/ruff\formatter/src · high confidence

Introduce the new ty playground UI

The ty playground now features a completely redesigned interface built with React and Monaco Editor. Users can manage multiple files, view detailed diagnostics with sub-diagnostics and secondary annotations, and access a secondary panel to inspect the AST, tokens, or run Python code via Pyodide. The editor supports semantic highlighting, inlay hints, and vendored standard library file viewing, while sharing and exporting are handled through URL persistence, markdown copying, and zip downloads.

playground/ty · high confidence

Introduce the ty Language Server

The \ty\_server\ crate is added, implementing the Language Server Protocol (LSP) for the ty type checker. This new server component enables editor integrations by providing core LSP features including diagnostics, completions, hover information, inlay hints, semantic tokens, and notebook support. It handles client capability negotiation, manages workspace folders, and exposes configuration options for logging and diagnostic modes, effectively serving as the bridge between ty's analysis engine and user editors.

_crates/ty\server · high confidence

Introduce ty\_python\_core crate for internal semantic indexing

The \ty\_python\_core\ crate has been added as a new internal component of Ruff (version 0.17.0) to house the core data structures and logic for Python semantic indexing. This location-specific change introduces the foundational types for the semantic index, including \AstIds\ for stable expression identification, \AstNodeRef\ for stable AST node references, and the \SemanticIndexBuilder\ for constructing use-def maps and flow states. It also provides the \Db\ trait for accessing this semantic information and defines the core \Definition\ and \Expression\ types that represent bindings and type-inferable expressions within the analysis engine.

_crates/ty\_python\core · high confidence

Introduction of the ty\_static crate for centralized environment variable definitions

A new internal crate, \ty\_static\, has been added to centralize the definitions of environment variables used by \ty\ and its components. This crate exposes constants for configuration and control variables such as \TY\_LOG\, \TY\_CONFIG\_FILE\, \TY\_OUTPUT\_FORMAT\, \TY\_MEMORY\_REPORT\, \TY\_MAX\_PARALLELISM\, and \TY\_UV\, as well as standard Python/Conda environment variables like \PYTHONPATH\, \VIRTUAL\_ENV\, and \CONDA\_PREFIX\. By consolidating these definitions, the crate ensures consistent usage across the codebase and provides a single source of truth for \ty\'s environment-based configuration.

_crates/ty\static · high confidence

New Airflow linting rules for migration to Airflow 3

Ruff now includes a comprehensive suite of rules to help users migrate Airflow DAGs to version 3.0 and 3.1. These rules detect deprecated or removed symbols (AIR301, AIR311), flag items moved to provider packages (AIR302, AIR312), and identify function signature changes that will cause runtime errors (AIR303). Additional checks warn about moved modules in Airflow 3.1 (AIR321), runtime-varying values in DAG constructors that cause infinite versioning (AIR304), and suggest replacing branching logic with short-circuit operators (AIR004). The linter also enforces explicit schedule arguments for DAGs (AIR002) and flags unsafe patterns like using Variable.get() outside task context (AIR003) or XCom pulls in template strings (AIR201).

_crates/ruff\linter/src/rules/airflow/rules · high confidence

New FLY002 rule to suggest replacing static string joins with f-strings

The linter now includes a new rule, FLY002, which detects \str.join\ calls with static arguments and suggests replacing them with f-strings for better readability. The fix is marked as unsafe because f-string evaluation uses the \\_\format\\_\ method, which may produce different results or raise exceptions compared to the original \str.join\ behavior. The implementation handles quote preservation and raw string edge cases, such as using triple quotes for raw strings containing newlines.

_crates/ruff\linter/src/rules/flynt/rules · high confidence

New FastAPI lint rules for redundant response models, non-annotated dependencies, and unused path parameters

Ruff now includes three new FastAPI-specific lint rules: FAST001 flags and auto-fixes redundant \response\_model\ arguments when the return type already specifies the model; FAST002 detects FastAPI dependency injections (like \Depends\, \Query\, \Body\) that lack \typing.Annotated\ and offers an unsafe fix to wrap them, importing from \typing\ for Python 3.9+ or \typing\_extensions\ for older versions; and FAST003 identifies path parameters defined in route URLs but missing from the handler function signature, providing an unsafe fix to add them. These rules help enforce modern FastAPI typing practices and prevent runtime errors from mismatched route definitions.

_crates/ruff\linter/src/rules/fastapi/snapshots · high confidence

New FastAPI linting rules for response models, dependencies, and path parameters

Ruff now includes three new FastAPI-specific lint rules: FAST001 detects redundant response models, FAST002 flags non-annotated dependencies, and FAST003 identifies unused path parameters. These rules are available for immediate use, with autofix support for FAST002 that adapts to the target Python version (using \typing\_extensions\ for Python 3.8 and \typing.Annotated\ for 3.9+).

_crates/ruff\linter/src/rules/fastapi · high confidence

New FastAPI linting rules: FAST001, FAST002, and FAST003

Ruff now includes three new linter rules for FastAPI applications. FAST001 (\fastapi-redundant-response-model\) flags routes where the \response\_model\ argument in a decorator matches the function's return type, suggesting it be removed. FAST002 (\fastapi-non-annotated-dependency\) encourages using \typing.Annotated\ for route dependencies (like \Depends\, \Query\, etc.) instead of using them as default parameter values, offering an unsafe fix to refactor the signature. FAST003 (\fastapi-unused-path-parameter\) detects path parameters defined in the route URL that are missing from the function's argument list, helping prevent runtime errors due to missing injected values.

_crates/ruff\linter/src/rules/fastapi/rules · high confidence

New IDE features: call hierarchy, document highlights, and all-symbols API

The \ty\_ide\ crate now exposes several new language server capabilities. Call hierarchy support allows users to see incoming and outgoing calls for functions and classes. Document highlights highlight all references to a symbol within the current file. An \all\_symbols\ API provides a workspace-wide symbol search, filtering out non-first-party test and private modules while retaining private typeshed packages. Additionally, annotation expression detection helps identify when code is inside a type annotation, and code actions now offer quick fixes for unresolved references and diagnostic suppression.

_crates/ty\ide · high confidence

New NumPy 2.0 migration and deprecation rules

This change introduces four new linting rules to help migrate code to NumPy 2.0: NPY001 flags deprecated type aliases (like \np.int\) and suggests builtin replacements; NPY002 detects legacy \np.random\ functions and recommends the \Generator\ API; NPY003 identifies deprecated functions (such as \np.alltrue\) with automatic fixes; and NPY201 covers a broad range of removed NumPy 2.0 members, providing automatic fixes for backwards-compatible replacements and manual migration guidance for breaking changes.

_crates/ruff\linter/src/rules/numpy/rules · high confidence

New SLF001 rule to detect private member access

The linter now includes the \SLF001\ rule (PrivateMemberAccess) which flags accesses to class members prefixed with an underscore, as these are considered private and may change in future versions. The rule ignores accesses to dunder and sunder methods, allows specific underscore-prefixed public functions (like \os.\_exit\), and permits accesses on \self\, \cls\, \mcs\, and \super()\ calls. It also respects the \lint.flake8-self.ignore-names\ configuration option.

_crates/ruff\_linter/src/rules/flake8\self/rules · high confidence

New UP052 rule to flag incorrect iterator annotations in context managers

Ruff now includes a new lint rule (UP052) that detects when generator-based context managers are annotated with \Iterator\ or \AsyncIterator\ instead of the correct \Generator\ or \AsyncGenerator\. This change helps users avoid runtime issues, as \contextlib.contextmanager\ requires generator-specific methods that standard iterators do not guarantee. The rule provides an unsafe autofix to replace the incorrect type hints with the appropriate \Generator\ types.

_crates/ruff\linter/src/rules/pyupgrade/rules · high confidence

New \`ruff\_dev\` tooling for formatter stability checks and documentation generation

The \ruff\_dev\ crate now includes a \format\_dev\ module that enables formatter stability (idempotency) checks and ecosystem formatting comparisons, switching the diffing metric from the Jaccard index to a similarity index for better readability. It also introduces a suite of code-generation commands (\cargo dev generate-all\) that automatically produce and update CLI help, JSON schemas, configuration references, rule tables, and documentation for both Ruff and the \ty\ type checker, with CI checks to ensure generated files remain up-to-date.

_crates/ruff\dev · high confidence

New \`ruff\_graph\` crate for analyzing Python module dependencies

A new \ruff\_graph\ crate has been introduced to power the \ruff analyze graph\ subcommand, enabling users to generate dependency graphs for Python projects. This component parses Python source files to collect imports—including standard imports, relative imports, and optional string-based imports—and resolves them against the project's search paths (including virtual environments and vendored typeshed). It exposes settings to control behavior such as skipping \TYPE\_CHECKING\ blocks, configuring minimum dots for string import detection, and determining graph direction (dependencies vs. dependents).

_crates/ruff\graph/src · high confidence

New and updated lint rule snapshots for the Refurb plugin

The Refurb linter now includes snapshot tests for several new and updated rules, providing autofix suggestions for common Python patterns. FURB161 suggests replacing \bin(x).count('1')\ with \int.bit\_count()\. FURB132 recommends using \set.discard()\ instead of checking membership and then calling \remove()\. FURB131 suggests using \list.clear()\ instead of deleting a full slice. FURB116 offers to replace \oct()\, \hex()\, and \bin()\ calls with f-string formatting. FURB142 suggests using \set.update()\ or \set.difference\_update()\ instead of loops calling \add()\ or \discard()\. FURB122 suggests using \writelines()\ instead of loops calling \write()\. FURB162 suggests removing unnecessary timezone replacements with zero offsets. FURB156 suggests replacing hardcoded string charsets with \string\ module constants. FURB181 suggests using \hexdigest()\ instead of \.digest().hex()\. FURB110 suggests using the \or\ operator instead of ternary \if\ expressions. FURB136 suggests using \min()\ or \max()\ instead of ternary comparisons. FURB177 suggests using \Path.cwd()\ instead of \Path().resolve()\.

_crates/ruff\linter/src/rules/refurb/snapshots · high confidence

New benchmark suite for ty, formatter, parser, lexer, and linter

The \ruff\_benchmark\ crate now includes dedicated benchmarks for the \ty\ type checker, the formatter, the parser, the lexer, and the linter. The \ty\ benchmarks cover cold and incremental checks, module resolution, IDE auto-imports, script environment handling, and specific type-inference scenarios like constraint sets. The formatter, parser, and lexer benchmarks measure throughput on standard datasets (NumPy, Pydantic, Unicode) using the Criterion framework, while the linter benchmarks evaluate default, all, and preview rule sets. This provides a comprehensive baseline for tracking performance across all core Ruff components.

_crates/ruff\benchmark/benches · high confidence

New diagnostic output formats for CI and IDE integration

The \ruff\_db\ crate now includes snapshot tests for rendering diagnostics in Azure Pipelines, GitLab, GitHub, JUnit, JSON Lines, Pylint, and RDJSON formats. This enables users to integrate Ruff's linting results directly into CI/CD pipelines and IDE tooling that expect these specific output schemas, covering both standard code files and Jupyter notebook cells.

_crates/ruff\db/src/diagnostic/render/snapshots · high confidence

New diagnostic output formats in ruff\_db

The \ruff\_db\ crate now includes dedicated renderers for Azure DevOps, Concise, Full, GitHub, GitLab, JSON, JSON Lines, JUnit, Pylint, and RDJSON diagnostic formats. This adds structured and human-readable output options for CI/CD integration and IDE consumption, including support for notebook cell indices, fix diffs, and severity levels.

_crates/ruff\db/src/diagnostic/render · high confidence

New flake8-async rules for blocking calls and async patterns

The linter introduces several new checks in the \flake8-async\ plugin to prevent blocking the event loop and improve async code quality. New rules detect blocking operations in async contexts: \ASYNC210\ for blocking HTTP calls (e.g., \urllib\, \httpx.Client\), \ASYNC212\ for blocking \httpx.Client\ usage, \ASYNC230\ for blocking file opens (\open\, \Path.open\), \ASYNC240\ for blocking \os.path\ and \pathlib.Path\ methods, \ASYNC250\ for blocking \input()\ calls, and \ASYNC251\ for \time.sleep\. Additionally, \ASYNC100\ now treats \yield\ as a checkpoint in cancel scopes, \ASYNC109\ exempts methods decorated with \@typing.override\ and ignores \asyncio\ timeouts on Python \<3.11, \ASYNC110\ detects busy-wait loops using \sleep\, \ASYNC115\ marks its autofix as unsafe if comments are present, \ASYNC116\ detects sleeps \>24 hours, and \ASYNC119\ flags yields in context managers within async generators.

_crates/ruff\_linter/src/rules/flake8\async/rules · high confidence

New flake8-django lint rules for ModelForm, render, and model structure

The flake8-django rule set now includes several new checks to enforce Django best practices and security. DJ007 warns against using \fields = "\_\all\\"\ in ModelForms, and DJ006 flags the use of the \exclude\ attribute, both encouraging explicit field lists to prevent accidental data exposure. DJ003 detects the use of \locals()\ in Django \render\ calls, which can leak internal variables to templates. Additionally, DJ008 now checks for missing \\\str\\_\ methods in non-abstract models, DJ013 ensures \@receiver\ decorators are placed first, DJ001 advises against \null=True\ on string fields, and DJ012 enforces the Django Style Guide ordering of model body content (fields, managers, Meta, methods).

_crates/ruff\_linter/src/rules/flake8\django/rules · high confidence

New flake8-fixme rules to flag TODO, FIXME, XXX, and HACK comments

The linter now includes four new pedantic rules (FIX001–FIX004) that detect TODO, FIXME, XXX, and HACK comments in Python code. These rules encourage developers to resolve or remove these markers before deployment, though they can be ignored if such comments are used for documentation purposes.

_crates/ruff\_linter/src/rules/flake8\fixme/rules · high confidence

New flake8-pie lint rules for duplicate class fields, multiple startswith/endswith calls, and non-unique enums

The linter now includes several new checks in the flake8-pie category: PIE794 detects duplicate field definitions in classes and offers an unsafe fix to remove the redundant assignment; PIE810 identifies redundant \startswith\ or \endswith\ calls on the same value and suggests merging them into a single call with a tuple (fix marked unsafe if the argument type cannot be confirmed as a tuple); and PIE796 flags enums with duplicate values, excluding cases using \enum.auto()\ or stub-file ellipses. Additionally, the diff introduces rules for replacing empty lambdas with \list\/\dict\ builtins (PIE807), removing unnecessary dictionary unpacking (PIE800), and simplifying \range(0, x)\ calls (PIE808).

_crates/ruff\_linter/src/rules/flake8\pie/rules · high confidence

New flake8-pytest-style lint rules for assertion, fixture, and warning checks

This location introduces a comprehensive set of new lint rules for the \flake8-pytest-style\ plugin, covering assertion patterns, fixture usage, parameterization, and warning checks. Specifically, it adds rules to detect composite assertions (\PytestCompositeAssertion\), assertions inside \except\ blocks (\PytestAssertInExcept\), and assertions that always fail (\PytestAssertAlwaysFalse\). It enforces correct \pytest.fixture\ usage by checking for unnecessary parentheses (\PytestFixtureIncorrectParenthesesStyle\), positional arguments (\PytestFixturePositionalArgs\), and redundant \scope='function'\ (\PytestExtraneousScopeFunction\). The update also includes checks for \pytest.mark\ decorator styles (\PytestIncorrectMarkParenthesesStyle\), useless \usefixtures\ decorators (\PytestUseFixturesWithoutParameters\), and incorrect \pytest\ imports (\PytestIncorrectPytestImport\). Furthermore, it validates \pytest.mark.parametrize\ argument types (\PytestParametrizeNamesWrongType\, \PytestParametrizeValuesWrongType\), flags \mocker.patch\ calls using lambdas instead of \return\_value\ (\PytestPatchWithLambda\), and ensures \pytest.raises\ and \pytest.warns\ are used correctly with specific exceptions/warnings and match parameters (\PytestRaisesTooBroad\, \PytestWarnsTooBroad\, etc.).

_crates/ruff\_linter/src/rules/flake8\_pytest\style/rules · high confidence

New flake8-quotes rules for unnecessary and avoidable escaped quotes

The linter now includes two new checks in the flake8-quotes rules: Q003 (AvoidableEscapedQuote) and Q004 (UnnecessaryEscapedQuote). Q003 detects strings where the outer quote style can be changed to avoid escaping inner quotes (e.g., changing \"bar\\"s"\ to \'bar"s'\) and provides an automatic fix. Q004 detects strings with unnecessary escape characters on inner quotes that do not match the outer quote style (e.g., \"bar\\'s"\ to \"bar's"\) and also provides an automatic fix. Both rules respect the configured quote settings and are compatible with f-strings and t-strings, though they skip certain contexts like docstrings or nested f-string replacement fields to avoid invalid syntax generation.

_crates/ruff\_linter/src/rules/flake8\quotes/rules · high confidence

New flake8-tidy-imports rules for lazy imports and banned module-level imports

Ruff now enforces lazy-import policies and detects banned module-level imports. The new TID254 (lazy\_import\_mismatch) rule ensures imports match the configured require-lazy or ban-lazy settings, while TID255 (lazy\_import\_immediately\_resolved) flags lazy imports that are resolved immediately at module load time, defeating their purpose. Additionally, TID253 (banned\_module\_level\imports) prevents specific modules from being imported at the top level, encouraging lazy loading for expensive modules. These rules support fixes for single-member imports and recognize the \\\_lazy\modules\\_\ declaration.

_crates/ruff\_linter/src/rules/flake8\_tidy\imports/rules · high confidence

New flake8-type-checking rules for empty blocks, runtime casts, and type aliases

The linter introduces several new rules in the flake8-type-checking family to enforce stricter type-checking hygiene. TC005 now detects and removes empty \TYPE\_CHECKING\ blocks. TC006 ensures type expressions in \typing.cast()\ calls are quoted for consistency and performance. TC007 flags unquoted PEP 613 type aliases that reference symbols unavailable at runtime, while TC008 removes unnecessary quotes from type aliases. Additionally, TC010 detects invalid string members within \X \| Y\-style union types that would cause runtime errors.

_crates/ruff\_linter/src/rules/flake8\_type\checking/rules · high confidence

New formatting traits and iterator utilities in ruff\_formatter

The ruff\_formatter crate now exposes shared formatting traits and utilities to simplify code generation. It introduces the AsFormat and IntoFormat traits, allowing objects to be converted into format-aware representations, with specific implementations for references (&T) and optional fields (Option\<T\>) to enable formatting without manual unwrapping. Additionally, the FormattedIterExt trait provides a formatted() method for iterators, converting items into their formatted equivalents while preserving iterator traits like FusedIterator and ExactSizeIterator.

_crates/ruff\formatter · high confidence

New internal crate for Ruff configuration option metadata

The \crates/ruff\_options\_metadata\ crate has been added to provide a structured way to expose metadata for Ruff's configuration options. It introduces traits like \OptionsMetadata\ and \Visit\, along with types such as \OptionField\, \OptionSet\, and \OptionSetKind\, allowing the tool to introspect and document its configuration schema (e.g., distinguishing between TOML tables and arrays of tables). This internal component supports the generation of configuration documentation and validation by exposing option details like default values, types, and deprecation status.

_crates/ruff\_options\metadata · high confidence

New internal crate for manipulating Python import statements

Ruff introduces a new internal crate, \ruff\_python\_importer\, which provides low-level helpers for manipulating Python import statements. This crate exposes an \Insertion\ API that allows callers to precisely determine where and how to add new imports or splice additional members into existing \from ... import\ statements, handling details like docstrings, comments, and whitespace preservation. This refactors import-insertion logic out of the linter crate to make it reusable across Ruff's tools.

_crates/ruff\_python\importer · high confidence

New isort rules for required imports and import organization

The isort linter now includes two new rules: I002 (MissingRequiredImport) and I001 (UnsortedImports). I002 automatically adds any imports specified in the \lint.isort.required-imports\ setting to the top of files, ensuring that mandatory imports like \from \_\future\\_ import annotations\ are always present. I001 detects and fixes unsorted or unformatted import blocks by de-duplicating, grouping, and sorting them according to isort configuration, while preserving comments and handling edge cases like multi-statement lines.

_crates/ruff\linter/src/rules/isort/rules · high confidence

New linter rules for code simplification and readability

The linter introduces several new rules to the \refurb\ category to suggest more idiomatic Python patterns. These include replacing \bin(...).count('1')\ with \int.bit\_count()\ (FURB161), substituting \set.remove\ inside an \if\ check with \set.discard\ (FURB132), replacing \del list\[:\]\ with \list.clear()\ (FURB131), and consolidating \for\ loops that call \set.add\/\discard\ or \file.write\ into single \update\/\difference\_update\ or \writelines\ calls (FURB142, FURB122). Additional rules detect unnecessary \datetime.fromisoformat\ timezone replacements (FURB162), suggest f-strings over \bin\/\hex\/\oct\ slicing (FURB116), replace hardcoded string charsets with \string\ module constants (FURB156), use \hexdigest\ instead of \digest().hex()\ (FURB181), replace ternary \if\ expressions with the \or\ operator (FURB110), and replace \if\-based min/max logic with \min\/\max\ calls (FURB136).

_crates/ruff\linter/src/rules/refurb/rules · high confidence

New mdtest framework for type-checking tests

The \ty\_test\ crate introduces a new Markdown-based testing framework (mdtest) that allows type-checking and type-inference tests to be written directly in Markdown files. Users can now define test suites using embedded Python, type stub, and Jupyter notebook code blocks, with assertions for revealed types and diagnostics. The framework supports inline snapshotting of diagnostics, configuration via TOML blocks (including Python version, platform, and rule settings), and optional execution with external dependencies using virtual environments and lockfiles.

_crates/ty\test · high confidence

New perflint rules for dict iteration, list comprehensions, and list copying

The linter introduces several new performance-focused rules in the \perflint\ category. \PERF102\ (IncorrectDictIterator) now detects when \dict.items()\ is used but only the keys or values are needed, suggesting \dict.keys()\ or \dict.values()\ instead, with an unsafe auto-fix. \PERF403\ (ManualDictComprehension) identifies \for\ loops that build dictionaries and suggests replacing them with dictionary comprehensions or \dict.update()\ calls. \PERF401\ (ManualListComprehension) detects loops that append to a list and suggests list comprehensions or \list.extend()\. \PERF402\ (ManualListCopy) flags loops that simply copy an iterable into a list, recommending \list()\ or \list.copy()\. These rules help users write more performant and readable Python code by replacing manual iteration patterns with optimized built-ins or comprehensions.

_crates/ruff\linter/src/rules/perflint/rules · high confidence

New pydoclint rules for docstring parameter and return consistency

The pydoclint linter now includes rules to enforce consistency between function signatures and docstrings. It flags parameters documented in a docstring that do not exist in the function signature (DOC102), ensures that functions with return statements include a 'Returns' section (DOC201), and warns against 'Returns' sections in functions that do not return anything (DOC202). These checks help prevent misleading documentation and incomplete docstrings.

_crates/ruff\linter/src/rules/pydoclint/rules · high confidence

New pydoclint rules for missing or extraneous docstring sections

The pydoclint linter now enforces four new checks to ensure docstrings accurately reflect function signatures: DOC102 flags parameters documented in the docstring that are not present in the function signature; DOC201 and DOC202 require or forbid the 'Returns' section based on whether the function actually returns a value; and DOC402 and DOC403 require or forbid the 'Yields' section based on whether the function is a generator. These rules apply to both Google and NumPy style docstrings, helping users maintain consistent and accurate documentation.

_crates/ruff\linter/src/rules/pydoclint/snapshots · high confidence

New rules to adopt PEP 695 generic syntax

Ruff introduces four new lint rules to help modernize Python code to use the PEP 695 type parameter syntax (available in Python 3.12+). UP040 (\non-pep695-type-alias\) suggests replacing \TypeAlias\ annotations and \TypeAliasType\ assignments with the new \type\ keyword. UP046 (\non-pep695-generic-class\) and UP047 (\non-pep695-generic-function\) recommend converting classes and functions that rely on \Generic\ and standalone \TypeVar\s to use inline type parameters. Additionally, UP049 (\private-type-parameter\) flags PEP 695 type parameters that use leading underscores, suggesting they be renamed for better readability since their scope is already restricted to the class or function.

_crates/ruff\linter/src/rules/pyupgrade/rules/pep695 · high confidence

Playground API introduces short URL support with domain-restricted CORS

The playground API now supports storing and retrieving code snippets via short, unique IDs, enabling shareable playground links. To ensure security, the API enforces strict Cross-Origin Resource Sharing (CORS) policies, allowing requests only from specific trusted domains (playknot.ruff.rs, types.ruff.rs, and play.ty.dev) in production, while permitting all origins in development mode.

playground/api · high confidence

Ruff CLI now includes build-time Git metadata and supports linked worktrees

The \crates/ruff\ entry point now embeds Git commit information (hash, short hash, date, and last tag) directly into the binary via a new \build.rs\ script. This enables the \ruff version\ command to display accurate versioning details. The build script has also been updated to correctly handle Git linked worktrees by resolving the \.git\ file pointer and watching the correct HEAD and reference paths, ensuring metadata is captured accurately in non-standard repository setups.

crates/ruff · high confidence

Ruff Playground UI and Feature Overhaul

The Ruff playground has been rebuilt with a new React-based interface that introduces several user-facing capabilities. You can now export your configuration and code as a downloadable ZIP file, or copy the setup as Markdown (with or without a link) for easy sharing. A new Reset button allows you to quickly return to the default state. The diagnostics panel has been enhanced to display secondary annotations and sub-diagnostics, and the editor now supports quick fixes for overlapping diagnostic ranges. Additionally, the Settings editor allows you to copy your configuration as either ruff.toml or pyproject.toml, and the playground now supports restoring state from both legacy hash-based URLs and new database-backed shareable links.

playground/ruff · high confidence

Stabilize 15 Pylint rules

The \pylint\ rules \assert-on-string-literal\ (PLW0129), \await-outside-async\, \bad-dunder-method-name\ (PLW3201), \bad-open-mode\ (PLW1501), \bad-staticmethod-argument\ (PLW0211), \bad-str-strip-call\ (PLE1310), \bad-string-format-character\ (PLE1300), \bad-string-format-type\ (PLE1307), \bidirectional-unicode\ (PLE2502), \binary-op-exception\ (PLW0711), \boolean-chained-comparison\ (PLR1716), \collapsible-else-if\ (PLR5501), \compare-to-empty-string\ (PLC1901), \comparison-of-constant\ (PLR0133), and \comparison-with-itself\ (PLR0124) are now stable and no longer require preview mode to be enabled.

_crates/ruff\linter/src/rules/pylint/rules · high confidence

Stabilize ISC004 rule for implicit string concatenation in collections

The ISC004 rule, which detects implicitly concatenated strings inside list, tuple, and set literals (often caused by missing commas), is now stable as of version 0.16.0. This new check helps prevent silent bugs where adjacent string literals are merged into a single element. When detected, Ruff provides an unsafe autofix that wraps the concatenated strings in parentheses to make the concatenation explicit, though users should verify if a missing comma was the actual intent.

_crates/ruff\_linter/src/rules/flake8\_implicit\_str\concat/rules · high confidence

Stabilize RUF063 to detect unsafe annotation access via \_\_dict\_\_

The linter now includes the \access-annotations-from-class-dict\ rule (RUF063), which flags code that retrieves class annotations using \foo.\_\dict\\.get("\\annotations\\")\ or \foo.\\dict\\\["\\annotations\\"\]\. This pattern is discouraged because it relies on implementation details and may fail to return annotations correctly in Python 3.14+ unless \from \\future\\_ import annotations\ is used. The rule suggests using stable public APIs like \annotationlib.get\_annotations\ (Python 3.14+), \inspect.get\_annotations\ (Python 3.10+), or \typing\_extensions.get\_annotations\ (for older versions).

_crates/ruff\linter/src/rules/ruff/rules · high confidence

Stabilize TID254 and TID255 lint rules for lazy imports

The \flake8-tidy-imports\ rules TID254 (\lazy-import-mismatch\) and TID255 (\lazy-import-immediately-resolved\) are now stable. TID254 flags eager imports that should be converted to lazy imports (e.g., \import typing\ should be \lazy import typing\), while TID255 detects lazy imports that are resolved immediately and suggests converting them back to eager imports. These rules now provide unsafe auto-fixes to automatically convert between eager and lazy import styles.

_crates/ruff\_linter/src/rules/flake8\_tidy\imports/snapshots · high confidence

Stabilize flake8-bandit security rules

The flake8-bandit rules located in this directory are now stable and enabled by default. This includes S101 (assert\_used), S102 (exec\_used), S103 (bad\_file\_permissions), S104 (hardcoded\_bind\_all\_interfaces), S105 (hardcoded\_password\_string), S106 (hardcoded\_password\_func\_arg), S107 (hardcoded\_password\_default), S108 (hardcoded\_tmp\_directory), S201 (flask\_debug\_true), S324 (hashlib\_insecure\_hash\_functions), S608 (hardcoded\_sql\_expression), S610 (django\_extra), S611 (django\_raw\_sql), S612 (logging\_config\_insecure\_listen), S701 (jinja2\_autoescape\_false), and S702 (mako\_templates). Users will now receive security diagnostics for these patterns without needing to enable preview mode.

_crates/ruff\_linter/src/rules/flake8\bandit/rules · high confidence

Stabilize trailing comma checks for type parameter lists

The \flake8\_commas\ rules \COM812\ and \COM819\ are now stable, extending trailing comma validation to type parameter lists (e.g., \def foo\T, U\: ...\). This ensures consistent linting behavior for generic type definitions alongside existing checks for function parameters, call arguments, and literals.

_crates/ruff\_linter/src/rules/flake8\commas/rules · high confidence

Support for lazy imports in autofixes

The import modification logic now supports adding imports with an explicit \lazy\ keyword. When generating fixes, the \Importer\ can insert imports prefixed with \lazy\, allowing rules to defer module loading during fix execution. This enables new autofix capabilities for rules that benefit from or require lazy evaluation of type annotations or other imports.

_crates/ruff\linter/src/importer · high confidence

Vendor real-world Python source files for performance benchmarking

The benchmark suite now includes a \resources\ directory containing vendored source files from popular open-source projects (NumPy, Pydantic, pypinyin, mikeio, and the Python 3.12 tomllib standard library). These files allow Ruff's performance benchmarks to run against real-world codebases rather than synthetic examples, and are included to enable offline benchmarking and simplify setup.

_crates/ruff\benchmark/resources · high confidence

Vendor unicode\_names2 for Unicode 17.0 support

The \crates/ruff\_unicode\_names2\ crate has been vendored from upstream, bringing support for the Unicode 17.0 standard. This includes updated character data files (\UnicodeData.txt\ and \NameAliases.txt\) and a build system that generates compressed lookup tables at compile time. The crate provides efficient, zero-runtime-overhead mapping between Unicode characters and their standard names, supporting both runtime lookups and compile-time macros.

_crates/ruff\_unicode\names2 · high confidence

Vendor unicode\_names2 generator crate

The \ruff\_unicode\_names2\_generator\ crate has been added to the repository, vendoring the \unicode\_names2\ source code to generate Unicode name data. This internal component parses Unicode data files to build optimized lookup structures, including a perfect hash table (PHF) for codepoint names and a trie for CJK ideograph ranges, enabling Ruff to efficiently resolve character names during linting.

_crates/ruff\_unicode\_names2\generator · high confidence

flake8-errmsg: EM101 now supports byte strings

The EM101 rule (Exception must not use a string literal) has been extended to detect and provide fixes for byte string literals (e.g., \b"..."\) in exception arguments. When a byte string is used directly in a \raise\ statement, Ruff now suggests assigning it to a variable first, mirroring the existing behavior for regular string literals and f-strings.

_crates/ruff\_linter/src/rules/flake8\errmsg/snapshots · high confidence

Removals

Removal of initial linter prototype implementation

The initial prototype implementation of the linter has been removed from the source code. This change deletes the core modules that previously handled AST parsing, basic linting logic (specifically the F403 import-star-usage check), caching, and message formatting. The \src/lib.rs\ module is also removed, indicating the deletion of the library's public interface for this prototype.

src · high confidence

Remove deprecated ANN101 and ANN102 rules

The linter has removed the ANN101 (missing type annotation for \self\) and ANN102 (missing type annotation for \cls\) rules. These rules are no longer enforced because modern type checkers can infer these types automatically, making explicit annotations unnecessary.

_crates/ruff\_linter/src/rules/flake8\annotations/rules · high confidence

Removed src/bin/main.rs CLI entry point

The main binary entry point for the rust-python-linter CLI has been removed from the source tree. This eliminates the command-line interface that previously accepted a filename or directory path, configured logging verbosity, and executed the linter using parallel processing via rayon.

src/bin · high confidence

Architecture

Extracted site-packages discovery into a dedicated internal crate

The logic for locating \site-packages\ directories and inferring Python versions has been extracted into the new \ty\_site\_packages\ crate. This change introduces utilities to discover search paths across different platforms (including support for Debian/Ubuntu \dist-packages\), infer the Python version from installation directory layouts on Unix, and track the source of version information (e.g., config files, CLI arguments, or environment metadata) to improve diagnostic accuracy.

_crates/ty\_site\packages · high confidence

Introduce \`ruff\_linter\` crate with core linting infrastructure

The linter logic has been reorganized into a dedicated \ruff\_linter\ crate, exposing a stable(ish) public API for core components like the \Locator\, \RuleSelector\, and \Fix\ types. This change introduces new internal modules for handling path normalization and package root detection, and adds a \LineLength\ type to enforce a maximum line length of 65535 characters. Additionally, a new \doc\_lines\ module has been added to extract standalone comments and string literals from source code.

_crates/ruff\linter/src · high confidence

Introduce dedicated checkers for filesystem, imports, logical lines, noqa, physical lines, and tokens

The linter now organizes its analysis into distinct, specialized checkers. The new \filesystem\ checker handles module naming and namespace package validation, while the \imports\ checker manages import sorting and required imports. A \logical\_lines\ checker enforces whitespace and indentation rules, and a \physical\_lines\ checker validates line lengths and trailing whitespace. The \noqa\ checker centralizes suppression logic, and the \tokens\ checker processes low-level syntax elements like comments and string concatenations. This modularization improves the structure and maintainability of the linting engine.

_crates/ruff\linter/src/checkers · high confidence

Introduce standalone \`ty\_module\_resolver\` crate for Python import resolution

The Python module resolution logic has been extracted into a new, standalone crate (\ty\_module\_resolver\). This change provides a dedicated API for resolving Python modules, including support for listing available modules, matching module names against glob patterns (e.g., for \allowed-unresolved-imports\), and handling namespace packages. The resolver is now environment-aware, meaning resolution results are cached and distinguished based on the specific Python version and search paths used, ensuring correct behavior when different environments (like scripts vs. projects) resolve the same imports differently. This refactoring also includes a formalized flow diagram for import resolution rules to serve as a specification for the implementation.

_crates/ty\_module\resolver · high confidence

Introduction of the ruff\_python\_semantic crate

The internal semantic analysis logic has been extracted into a new \ruff\_python\_semantic\ crate (version 0.0.17). This change introduces dedicated modules for analyzing class hierarchies, function types, imports, logging, and type inference, alongside a new control flow graph infrastructure for tracking jumps and returns. For users, this represents a structural reorganization of Ruff's internals that improves the modularity and maintainability of linting rules without altering the external API or rule behavior.

_crates/ruff\_python\semantic · high confidence

Lint rules are now executed via a modular, AST-node-specific analysis phase

The AST checker's analysis logic has been reorganized into a dedicated \analyze\ module containing separate handlers for each AST node type (e.g., \bindings\, \statements\, \expressions\, \deferred\_scopes\). This change moves rule execution from the main traversal loop into these specialized modules, allowing the linter to run specific checks—such as unused variable detection, import conventions, and type annotation rules—only when the relevant node types are encountered and the corresponding rules are enabled.

_crates/ruff\linter/src/checkers/ast/analyze · high confidence

Linter rules module reorganization

The linter's rule modules have been reorganized into a new \rules\ module within the \ruff\_linter\ crate. This change consolidates the public API for all supported linter plugins (such as FastAPI, Flake8 variants, Pydoclint, and others) under a single \mod.rs\ file, establishing the structural foundation for the renamed \ruff\_linter\ crate.

_crates/ruff\linter/src/rules · high confidence

Refactor flake8-simplify rules into dedicated source files

The flake8-simplify linting rules have been reorganized from a single monolithic module into separate, dedicated source files (such as ast\_bool\_op.rs, ast\_expr.rs, ast\_ifexp.rs, ast\_unary\_op.rs, ast\_with.rs, collapsible\_if.rs, enumerate\_for\_loop.rs, and others). This structural change improves code maintainability and readability without altering the linting behavior or capabilities exposed to users.

_crates/ruff\_linter/src/rules/flake8\simplify/rules · high confidence

Refactor pep8-naming rules into individual modules

The pep8-naming linting rules have been reorganized from a single monolithic file into separate, dedicated source files (e.g., \invalid\_function\_name.rs\, \invalid\_class\_name.rs\, \camelcase\_imported\_as\_acronym.rs\). This change improves code maintainability and modularity without altering the linting behavior or output for users.

_crates/ruff\_linter/src/rules/flake8\_use\_pathlib/rules, crates/ruff\_linter/src/rules/pep8\naming/rules · high confidence

Refactor project database and file indexing architecture

The project database and file indexing logic has been restructured to improve performance and maintainability. The \ProjectDatabase\ now uses a dedicated \IndexedFiles\ structure with lazy indexing and internal mutability to avoid unnecessary Salsa invalidations, while file inclusion and exclusion are handled by new, portable glob filters (\IncludeFilter\, \ExcludeFilter\) that support PEP 639 syntax and anchored patterns. Additionally, the database now better tracks open files and script environments, allowing for more efficient incremental updates and synchronization of PEP 723 scripts.

_crates/ty\project · high confidence

Ruff 0.17.0 workspace configuration and settings architecture

Ruff 0.17.0 introduces a new internal workspace crate (\ruff\_workspace\) that centralizes configuration loading, file resolution, and settings management. This change restructures how Ruff reads \pyproject.toml\ and \ruff.toml\ files, consolidating the \Configuration\, \Options\, and \Resolver\ logic into a dedicated module. Users benefit from improved configuration inheritance, better error reporting for TOML parsing, and a more robust file discovery system that respects hierarchical project structures. The new architecture also standardizes settings across the linter, formatter, and analyzer, ensuring consistent behavior for options like \line-length\, \target-version\, and file exclusions.

_crates/ruff\workspace · high confidence

Ruff linter rules reorganized into individual files

The pycodestyle linting rules have been restructured from a single monolithic module into separate, individual files (e.g., \ambiguous\_class\_name.rs\, \blank\_lines.rs\, \compound\_statements.rs\). This change improves code maintainability and modularity by isolating each rule's implementation, while the \mod.rs\ file now explicitly re-exports these individual modules to maintain the public API.

_crates/ruff\linter/src/rules/pycodestyle/rules · high confidence

pydocstyle rules restructured into individual modules

The pydocstyle linting rules have been reorganized from a single monolithic file into separate, individual modules (e.g., \backslashes.rs\, \blank\_after\_summary.rs\, \indent.rs\). This change improves code maintainability and clarity by isolating the logic for each specific rule (such as D205, D400, D403, and D301) into its own file, while the \mod.rs\ file now serves as the central registry for these components.

_crates/ruff\linter/src/rules/pydocstyle/rules · high confidence

Behavioural changes

2842 commits (121 fixes) modifying (repo-wide)

A change to existing behaviour in (repo-wide) — 2842 commits (121 fixs), 26 files: “\[\flake8-simplify\\] Implement \enumerate-for-loop\ (\SIM113\) (\#7777)”; “\[ty\] Check attribute and property override types (\#28556)”; “Use human-readable types for documentation values (\#2375)”; and 2828 more (refs \#7777, \#28556, \#2375, \#406, \#28455, …).

(repo-wide) · low confidence · unverified

3306 commits (356 fixes) modifying crates/ty\_python\_semantic

A change to existing behaviour in crates/ty\_python\_semantic — 3306 commits (356 fixs), 1217 files: “\[ty\] Check attribute and property override types (\#28556)”; “\[ty\] Normalize runtime unions on demand (\#29727)”; “\[ty\] Reduce false positives for \TypedDict\ types (\#19354)”; and 3303 more (refs \#28556, \#29727, \#19354, \#28369, \#29664, …).

_crates/ty\_python\semantic · medium confidence · unverified

5 commits (2 fixes) modifying crates/ruff\_linter/src/rules/flake8\_simplify/snapshots

A change to existing behaviour in crates/ruff\_linter/src/rules/flake8\_simplify/snapshots — 5 commits (2 fixs), 37 files: “Show more nonprinting characters in diagnostic fix diffs (\#30062)”; “\[flake8-simplify\] Preserve operand order in SIM109 fix (\#27824)”; “\[\flake8-simplify\\] Report collapsible \elif\ clauses after a multi-statement \if\ branch (\SIM102\) (\#29814)”; and 2 more (refs \#30062, \#27824, \#29814, \#27821, \#28049).

_crates/ruff\_linter/src/rules/flake8\simplify/snapshots · medium confidence · unverified

6 commits (1 fix) modifying crates/ruff\_command\_line/src

A change to existing behaviour in crates/ruff\_command\_line/src — 6 commits (1 fix), 2 files: “Use the report destination to color \ruff check\ diagnostics (\#29899)”; “\[ty\] Respect \FORCE\_COLOR\ in \ty check\ (\#29830)”; “Revert "Use the report destination to color \ruff check\ diagnostics" (\#29908)”; and 3 more (refs \#29899, \#29830, \#29908, \#29898, \#29910, …).

_crates/ruff\_command\line/src · medium confidence · unverified

Add autofix for future-rewritable-type-annotation (FA100) and introduce future-required-type-annotation (FA102)

The \flake8-future-annotations\ rules now provide automatic fixes. The existing \future-rewritable-type-annotation\ (FA100) rule can now automatically add the \from \_\future\\_ import annotations\ import to allow users to simplify type annotations (e.g., using \list\[str\]\ instead of \List\[str\]\) even on older Python versions. Additionally, a new rule \future-required-type-annotation\ (FA102) has been added to detect uses of PEP 585 (collections) and PEP 604 (unions) style annotations in modules that lack the required future import, flagging them as errors for Python versions prior to 3.9 and 3.10 respectively, and offering an unsafe fix to add the import.

_crates/ruff\_linter/src/rules/flake8\_future\annotations/rules · high confidence

Automated session setup and agent skills for the Claude Code environment

The Claude Code environment now automatically configures itself at the start of a session. It installs the GitHub CLI (\gh\) and Rust tooling (clippy, rustfmt), sets the \GH\_REPO\ environment variable to ensure correct repository context, and disables \cargo-nextest\ in favor of standard \cargo test\ to avoid installation delays. Additionally, the environment is configured to load custom agent skills from the \.agents\ directory, enabling specialized workflows for the project.

.claude · high confidence

Detect commented-out \`case\` statements in ERA001

The ERA001 rule (commented-out code) now detects commented-out \case\ statements, expanding its coverage beyond previous patterns. This change ensures that dead code in the form of commented \case\ blocks is flagged for removal, reducing false negatives in codebases that use pattern matching.

_crates/ruff\linter/src/rules/eradicate/rules · high confidence

Enforce \_\_slots\_\_ in subclasses of str, tuple, and namedtuple

The flake8-slinter rules now flag classes that subclass \str\, \tuple\, or \namedtuple\ (both \collections.namedtuple\ and \typing.NamedTuple\) without defining \\_\slots\\_\. This helps users reduce memory overhead by preventing the creation of instance dictionaries for these typically immutable types. The checks ignore stub files and, for \str\ subclasses, also ignore those that are enumerations.

_crates/ruff\_linter/src/rules/flake8\slots/rules · high confidence

Expanded debugger detection to include sys.breakpointhook and debugpy/ptvsd modules

The flake8-debugger rule (T100) now flags additional debugger usage patterns. Specifically, it detects calls to \sys.breakpointhook\ and \sys.\_\breakpointhook\\_\, as well as the use of \debugpy\ and \ptvsd\ debug modules (e.g., \debugpy.breakpoint\, \ptvsd.break\_into\_debugger\). This ensures that more modern or alternative debugging tools are caught alongside standard \pdb\ and \breakpoint\ usage.

_crates/ruff\_linter/src/rules/flake8\debugger/rules · high confidence

Expanded default import conventions and preview-only aliases

The flake8-import-conventions linter now includes additional default import aliases, such as \datetime as dt\, \numpy.typing as npt\, and \xml.etree.ElementTree as ET\, aligning with upstream conventions. Additionally, preview mode enables further aliases (\plotly.graph\_objects as go\, \statsmodels.api as sm\) and bans \geopandas\ using the \gpd\ alias, allowing users to adopt these standards immediately or opt into stricter checks via preview settings.

_crates/ruff\_linter/src/rules/flake8\_import\conventions · high confidence

Expanded flake8-builtins detection and configuration options

The flake8-builtins linter rules now detect class-scope builtin shadowing in decorators, default arguments, and attribute initializers (A003), and support shadowing checks for imports, lambdas, and modules. Configuration has been updated to allow an ignorelist for specific builtins, an allowed\_modules list for module shadowing (A005), and a strict\_checking mode to control how module names are compared against the standard library.

_crates/ruff\_linter/src/rules/flake8\builtins · high confidence

Expanded flake8-builtins rules for class-scope and lambda shadowing

The linter now detects more instances of builtin shadowing. Rule A003 (builtin-attribute-shadowing) has been stabilized and expanded to detect shadowing in class scopes, including decorators, default arguments, and attribute initializers, while restricting reports to actual shadowed references. Rule A002 (builtin-argument-shadowing) now explicitly ignores parameters in lambda expressions, which are covered by the new Rule A006 (builtin-lambda-argument-shadowing). Additionally, Rule A004 (builtin-import-shadowing) is stabilized, and Rule A005 (stdlib-module-shadowing) is stabilized with support for strict checking and allowed modules.

_crates/ruff\_linter/src/rules/flake8\builtins/rules · high confidence

Expanded semantic syntax error detection and updated test snapshots

The linter now detects a broader range of semantic syntax errors, including \await\ outside async functions, \yield\/\yield from\ outside functions, \return\ outside functions, annotated names declared as global, and various pattern-matching and comprehension errors (such as duplicate match keys and irrefutable case patterns). Additionally, the \PYI019\ rule now respects a configuration to disable adding \typing\_extensions\ imports, and notebook-specific linting has been refined to handle cell metadata and escape commands more accurately.

_crates/ruff\linter/src/snapshots · high confidence

Extract shared playground UI components and utilities

The playground's user interface has been refactored by extracting reusable components and utilities into the \playground/shared\ library. This includes a new \AstralButton\ component for consistent styling, a \Header\ that displays the tool logo (Ruff or ty), version tag, repository link, theme toggle, and a \ShareButton\ with options to share a link, copy markdown, or download a ZIP archive. Diagnostic display is now handled by \DiagnosticDetail\, which renders clickable location links and hyperlinks within messages, while \SideBar\ and \ResizeHandle\ components provide a consistent layout structure. Additionally, \setupMonaco\ centralizes Monaco editor configuration, including theme definitions and language support, and \downloadZip\ provides the logic for exporting playground content.

playground/shared · high confidence

Formatter documentation and test fixtures updated

The \ruff\_python\_formatter\ crate's documentation has been reorganized, with the \README.md\ now serving as the main entry point and a new \CONTRIBUTING.md\ detailing the development workflow, testing, and helper structs. Additionally, the Black compatibility test suite has been updated with new fixtures and expected outputs, including cases for empty first lines, annotations, async statements, and number literal attribute access.

_crates/ruff\_python\formatter · high confidence

Improved WSL detection and test skipping for executable rules

The flake8\_executable module now includes robust helpers to detect whether the linter is running under Windows Subsystem for Linux (WSL) or inside a container (Docker, Podman, etc.). This logic prevents false positives in environments where file permissions behave differently. Additionally, the test suite for executable rules (EXE001–EXE005) is now automatically skipped when running in a WSL environment to avoid flaky or incorrect test results.

_crates/ruff\_linter/src/rules/flake8\executable · high confidence

Improved detection of commented-out code with expanded pattern support and stricter ignore rules

The commented-out code rule (ERA001) now detects single-line control structures such as \try:\, \except:\, \case\, \elif\, \else\, and \finally\, as well as partial dictionary entries and multiline assignments that were previously missed. It also ignores more specific pragmas, including \ruff:disable\, \ruff:enable\, \ruff:ignore\, \ruff:file-ignore\, \ty: ignore\, and IntelliJ language injection comments (\language=...\), reducing false positives. The detection logic uses a fast-path Aho-Corasick check and a tokenizer to quickly reject non-code comments, improving performance.

_crates/ruff\linter/src/rules/eradicate · high confidence

Improved diagnostic rendering with whitespace trimming and cell-aware suggestions

The diagnostic renderer now intelligently trims excessive leading whitespace in code snippets to keep the focus on the relevant error location, while ensuring labels and spans remain correctly aligned. It also fixes the display of Jupyter cell indices in suggestions, ensuring the cell index is always shown and the file path is hidden when only the cell changes, preventing confusing or redundant output. Additionally, the renderer now supports customizing the cut indicator string and includes fixes for false-positive line trimming and panics when annotations point to leading whitespace.

_crates/ruff\_annotate\snippets/src/renderer · high confidence

Internal rule set implementation refactored to use a 16-bit bitset

The internal representation of the rule set in the linter registry has been replaced with a new \RuleSet\ struct backed by a 16-element array of \u64\ integers, enabling efficient bitwise operations for rule inclusion, union, subtraction, and intersection checks. This change modifies how the linter internally tracks and manipulates collections of active rules, optimizing performance for rule filtering and combination logic without altering the external rule codes or configuration interface.

_crates/ruff\linter/src/registry · high confidence

Introduce CacheKey trait for deterministic cache hashing

The \ruff\_cache\ crate now exposes a \CacheKey\ trait and \CacheKeyHasher\ to allow types to participate in cache key generation. This trait ensures deterministic and portable cache keys by explicitly serializing field values, addressing previous issues with cache key collisions on paths with separators. Implementations are provided for standard numeric types, \FileTime\, and \GlobMatcher\, enabling consistent cache lookups across different platforms and file structures.

_crates/ruff\cache/src · high confidence

Introduce VendoredPath and VendoredPathBuf types

The \crates/ruff\_db/src/vendored\ module now includes \VendoredPath\ and \VendoredPathBuf\ types, which wrap \camino::Utf8Path\ and \Utf8PathBuf\ respectively. These types provide a specialized API for handling paths within the vendored typeshed environment, including methods for file name extraction, extension manipulation (such as \with\_pyi\_extension\), and path joining. The implementation supports conversions from standard string and path types and integrates with the \get-size2\ crate for memory tracking.

_crates/ruff\db/src/vendored · high confidence

Introduce WASM build with explicit logging and Git versioning

The \ty\_wasm\ crate now includes a build script that embeds the Git commit short hash into the WASM binary, making the version available via the \version()\ API instead of a placeholder. Additionally, logging in the WASM environment is no longer automatic; users must explicitly call \initLogging\ to enable console output, which prevents unintended initialization side effects.

_crates/ty\wasm · high confidence

Introduce configurable printer options for indentation, line width, and line endings

The formatter now exposes a \PrinterOptions\ struct that allows users to configure how the printer outputs code. This includes setting the \indent\_style\ (tabs vs. spaces), \indent\_width\ (number of spaces per indent level), and \line\_width\ (maximum line length). Additionally, users can specify the \line\_ending\ style (LF, CRLF, or CR) to match their target platform or repository conventions. These options are derived from the existing \FormatOptions\ trait and provide the foundational configuration for the formatting engine's output behavior.

_crates/ruff\_formatter/src/printer/printer\options · high confidence

Introduce fix safety table to override rule fix applicability

Ruff now includes a \FixSafetyTable\ in its linter settings that allows users to explicitly promote or demote the safety level of specific rule fixes via \extend-safe-fixes\ and \extend-unsafe-fixes\ configuration options. This table resolves rule selectors against the current preview mode and applies specificity-based overrides, ensuring that fixes marked as safe or unsafe in the configuration take precedence over the rule's default applicability, while display-only fixes remain unaffected.

_crates/ruff\linter/src/settings · high confidence

Linter rules now use LinterSettings for configuration

The flake8\_fixme, flake8\_raise, and flake8\_todos rule modules have been updated to initialize their test fixtures using \settings::LinterSettings::for\_rule\ instead of the previous configuration method. This change aligns these rule sets with the new \LinterSettings\ structure, ensuring that rule-specific settings are applied consistently during linting and testing.

_crates/ruff\_linter/src/rules/flake8\_fixme, crates/ruff\_linter/src/rules/flake8\_raise, crates/ruff\_linter/src/rules/flake8\todos · high confidence

McCabe complexity now accounts for match-case statements

The C901 (function-is-too-complex) rule has been updated to include Python \match\ statements in its complexity calculation. This means that functions using structural pattern matching will now have their control-flow complexity evaluated more accurately, potentially triggering diagnostics for code that was previously considered less complex. The implementation treats match cases as decision points, with specific handling for irrefutable patterns to avoid over-counting complexity similar to \if/else\ blocks.

_crates/ruff\linter/src/rules/mccabe/rules · high confidence

New CST helpers for safe negation and expression matching

The linter now includes a new \cst\ module with helper utilities for code modification. A key addition is the \negate\ function, which correctly handles the negation of boolean expressions by wrapping high-precedence operations (such as \and\, \or\, lambdas, and conditional expressions) in parentheses to preserve Python operator precedence. The module also provides a suite of \match\\\ functions to safely extract and manipulate specific CST nodes like calls, imports, and function definitions.

_crates/ruff\linter/src/cst · high confidence

New diagnostic rendering engine in ruff\_db

The \ruff\_db\ crate now includes a new diagnostic rendering system that replaces the previous implementation. This change introduces a new \Diagnostic\ type and a modular renderer architecture supporting multiple output formats, including Concise, Full, Azure, GitHub, GitLab, JSON, JSON Lines, RDJSON, Pylint, and JUnit. The new system leverages the \annotate-snippets\ library for rich, colorized source code annotations and supports hyperlinks in terminal output. It also provides a \DiagnosticStylesheet\ for customizable styling and handles complex scenarios like notebook cell indices and sub-diagnostics.

_crates/ruff\db/src/diagnostic · high confidence

New diagnostic rendering infrastructure with grouped and SARIF emitters

Ruff introduces a new message emission system in \crates/ruff\_linter/src/message\ that replaces the previous internal diagnostic types with the unified \ruff\_db::diagnostic::Diagnostic\ model. This change adds a \GroupedEmitter\ for human-readable, file-grouped output (supporting Jupyter notebook cell translation, fix status display, and configurable rule code formatting) and a \SarifEmitter\ for generating SARIF 2.1.0-compliant JSON reports. The implementation also includes logic to create diagnostics from panics and lint violations, integrating fix applicability, secondary codes, and documentation URLs directly into the diagnostic structure for consistent rendering across output formats. Also in this area: 13 commits (0 fixes) modifying crates/ruff\_linter; Improved f-string conversion safety and diagnostic rendering architecture.

_crates/ruff\linter/src/message · medium confidence · unverified

New fix application engine with prioritized ordering and isolation

The \crates/ruff\_linter/src/fix\ module has been restructured into a new fix application engine (\mod.rs\, \edits.rs\, \codemods.rs\, \snippet.rs\). This change introduces a deterministic fix application order that prioritizes specific rule interactions—such as applying \RedefinedWhileUnused\ before \UnusedImport\ to prevent conflicts—and enforces fix isolation groups to prevent overlapping edits. It also adds support for tracking fix applicability (safe vs. unsafe) and provides improved utilities for generating code edits, such as preserving trailing comments during import removal and handling complex statement deletions.

_crates/ruff\linter/src/fix · high confidence

New formatting document structure and tag system

The formatter now uses a new \Document\ structure to hold formatted elements and a comprehensive \Tag\ enum to manage formatting contexts like groups, indentation, and best-fitting logic. This change introduces support for \BestFitParenthesize\ tags, which allow parentheses to be added only when they help content fit within the line width, and \LineSuffix\ tags with reserved width to handle trailing content during measurement. The \Document\ also includes logic to propagate expansion modes through nested groups, ensuring consistent line-breaking behavior across complex formatted structures.

_crates/ruff\_formatter/src/format\element · high confidence

New import-banning and lazy-import enforcement rules in flake8-tidy-imports

The flake8-tidy-imports module now includes new linting capabilities: you can ban specific APIs or modules (TID251, TID253) with custom messages, restrict relative imports to parents or all (TID252), and enforce lazy imports for selected modules while flagging those that are eagerly evaluated (TID254, TID255). These changes are driven by new matcher logic for module/member matching and expanded settings for ban policies and import selectors.

_crates/ruff\_linter/src/rules/flake8\_tidy\imports · medium confidence

Optimized incremental ignore-file checking for project indexing

The system now uses a specialized incremental matcher to determine which files are ignored during project indexing, replacing the previous approach. This change optimizes path checking by leveraging the \ignore\ crate's incremental capabilities, allowing for more efficient evaluation of \.gitignore\ and \.ignore\ files as the file system is walked. The implementation includes specific logic to handle root matchers, directory pruning, and edge cases such as BOM characters in ignore files and the precedence of \.ignore\ over \.gitignore\.

_crates/ruff\db/src/system/os · high confidence

Playground restructured with dedicated ty instance and Oxlint integration

The playground now includes a dedicated \ty\ application (at \playground/ty/\) for the Python type checker, featuring its own Vite configuration, HTML entry point, and static asset handling for Pyodide. The linting tooling has been switched to Oxlint, configured via a new \.oxlintrc.json\ file, and the repository is now organized as an NPM workspace with shared configuration files (\.npmrc\, \.gitignore\, \.prettierignore\) to enforce strict engine versions and ignore install scripts.

playground · high confidence

Pydocstyle rules reorganized into a dedicated module with configurable conventions

The pydocstyle linting rules have been restructured into a dedicated \pydocstyle\ module, introducing a \Convention\ setting that allows users to select Google, NumPy, or PEP257 docstring styles. This configuration automatically ignores rules incompatible with the chosen convention and enables smarter heuristic detection when no convention is explicitly set. The module also adds specific settings to ignore functions with certain decorators, exclude \\args\ and \\\*kwargs\ from documentation requirements, and define property decorators.

_crates/ruff\linter/src/rules/pydocstyle · high confidence

Pyflakes linter module restructured with new format helpers and settings

The \pyflakes\ rule module has been reorganized into dedicated source files, introducing \cformat.rs\ and \format.rs\ to parse and summarize C-style (\%\) and Python \.format()\ string arguments respectively, and \fixes.rs\ to provide safe autofixes for removing unused format arguments and exception bindings. Additionally, \settings.rs\ now exposes the \extend\_generics\ and \allowed\_unused\_imports\ configuration options for the Pyflakes rules.

_crates/ruff\linter/src/rules/pyflakes · high confidence

Pyflakes rules migrated to new module structure

The pyflakes linting rules have been reorganized into a new modular structure under \crates/ruff\_linter/src/rules/pyflakes/rules\. This change introduces dedicated source files for individual checks—including \assert\_tuple\, \break\_outside\_loop\, \continue\_outside\_loop\, \default\_except\_not\_last\, \f\_string\_missing\_placeholders\, \forward\_annotation\_syntax\_error\, \future\_feature\_not\_defined\, \if\_tuple\, \imports\, \invalid\_literal\_comparisons\, \invalid\_print\_syntax\, \raise\_not\_implemented\, \redefined\_while\_unused\, \repeated\_keys\, \return\_outside\_function\, \starred\_expressions\, and \strings\—and updates the module registry to export them. This refactoring improves code maintainability and separation of concerns for these specific linting rules.

_crates/ruff\linter/src/rules/pyflakes/rules · high confidence

Pylint plugin configuration and helper infrastructure

The \pylint\ linter plugin now exposes a dedicated configuration section (\linter.pylint\) allowing users to tune complexity thresholds (such as \max-args\, \max-bool-expr\, and \max-nested-blocks\) and customize allowed magic value types and dunder method names. This change also introduces helper utilities for the plugin, including logic to identify underscore-prefixed public members (specifically allowing \os.\_exit\) and a visitor to track sequence index accesses during iteration.

_crates/ruff\linter/src/rules/pylint · high confidence

RSE102 fix marked unsafe when removing parentheses deletes comments

The automatic fix for the RSE102 rule (Unnecessary parentheses on raised exception) is now classified as unsafe if the removal of parentheses would also delete comments attached to the code. This prevents the linter from silently discarding developer notes during auto-fixes, ensuring that such changes require manual review.

_crates/ruff\_linter/src/rules/flake8\_raise/rules, crates/ruff\_linter/src/rules/flake8\raise/snapshots · high confidence

Refactor AST checker into modular components with new annotation context logic

The AST checker in \crates/ruff\linter/src/checkers/ast\ has been restructured into separate modules (\annotation.rs\, \deferred.rs\, \mod.rs\) to improve code organization and maintainability. A key behavioral addition is the new \AnnotationContext\ enum and its associated logic, which determines whether type annotations are \RuntimeRequired\, \RuntimeEvaluated\, \RuntimeAmbiguous\, or \TypingOnly\ based on the current scope, \\\future\\_\ annotations, and stub file status. This change enables more precise handling of type-checking rules (like those in \flake8-type-checking\) by explicitly distinguishing between annotations that must be available at runtime versus those that are purely for type checkers. The \deferred.rs\ module introduces a structured \Visit\ collection to manage deferred AST node visitation, ensuring that function bodies and type definitions are processed in the correct evaluation order relative to parent scopes.

_crates/ruff\linter/src/checkers/ast · high confidence

Refactor docstring parsing into a modular, reusable library

The docstring analysis logic has been restructured from a monolithic implementation into a dedicated, modular library under \crates/ruff\_linter/src/docstrings\. This change introduces a new \Docstring\ struct to encapsulate docstring metadata and source ranges, a unified \SectionKind\ enum to standardize section names across styles, and distinct configuration arrays for Google-style (\GOOGLE\_SECTIONS\) and NumPy-style (\NUMPY\_SECTIONS\) docstrings. The refactoring also adds a new \extraction.rs\ module to handle the extraction of docstrings from AST definitions (modules, classes, and functions) and separates the section parsing logic into \sections.rs\ and \styles.rs\, improving code organization and maintainability for the linter's docstring rules.

_crates/ruff\linter/src/docstrings · high confidence

Refactor file path handling with new DirectoryListing and FileRoot abstractions

The file system abstraction in \crates/ruff\_db/src/files\ has been restructured to improve performance and correctness. A new \DirectoryListing\ struct provides a cached, sorted snapshot of directory contents, enabling faster lookups and efficient prefix matching for completion suggestions. File roots are now explicitly tracked via a \FileRoot\ model that assigns durability levels (LOW for project roots, HIGH for search paths) to influence change detection. Additionally, the \FilePath\ enum now explicitly distinguishes between system, system-virtual, and vendored paths, allowing the engine to handle different file sources with greater precision.

_crates/ruff\db/src/files · high confidence

Refactor flake8-async rule infrastructure and add new checks

The flake8-async rule module has been restructured with a new helpers.rs file that centralizes detection of async libraries (asyncio, anyio, trio) and their specific methods, improving how the linter identifies blocking calls. This change also introduces several new lint rules: ASYNC212 for blocking HTTP calls using httpx, ASYNC250 for blocking input operations, ASYNC119 for yield statements in context managers within async generators, and ASYNC240 for blocking path methods. Additionally, the ASYNC109 rule now correctly disables checks for asyncio usage before Python 3.11, and existing rules (ASYNC100, ASYNC109, ASYNC110, ASYNC115, ASYNC116) have been stabilized to match upstream flake8-async behavior.

_crates/ruff\_linter/src/rules/flake8\async · high confidence

Refactor flake8-comprehensions fixers to use libcst

The automatic fixers for flake8-comprehensions rules (such as C400, C402, C404, C406) have been rewritten to use the libcst library instead of the previous CST-based fixer. This change ensures that fixes are generated more reliably, preserving whitespace and comments correctly during transformations like converting \dict((x, x) for x in range(3))\ to \{x: x for x in range(3)}\.

_crates/ruff\_linter/src/rules/flake8\comprehensions · high confidence

Refactor flake8-executable rules to use token-based checking and new applicability model

The flake8-executable rules (EXE001–EXE005) have been restructured to operate on token-level comment ranges rather than AST nodes, with a new \from\_tokens\ entry point in \mod.rs\ that iterates over \CommentRanges\ to detect shebangs. This change introduces precise applicability handling for the \shebang\_leading\_whitespace\ (EXE004) fix, marking it as \Unsafe\ when the removed whitespace includes a newline to prevent accidental encoding declaration activation, while remaining \Safe\ for simple whitespace removal. Additionally, the \shebang\_missing\_python\ (EXE003) rule now explicitly recognizes \uv run\, \uv tool run\, and \uvx\ commands in shebangs via a dedicated regex, preventing false positives for modern Python tooling. The WSL detection logic for EXE001 and EXE002 has been updated to use the \is-wsl\ crate instead of the obsolete \wsl\ crate, ensuring correct behavior in non-Docker WSL environments.

_crates/ruff\_linter/src/rules/flake8\executable/rules · high confidence

Refactor flake8-logging rules to use derive macros and new naming conventions

The flake8-logging rules (LOG001, LOG002, LOG004, LOG007, LOG009, LOG014, LOG015) have been refactored to use the new \ViolationMetadata\ derive macro and \FixAvailability\ enum, replacing the previous \Violation\ trait implementations and \FixKind\ naming. This change standardizes how rule metadata, fix availability, and safety levels are defined across the linter, ensuring consistent behavior for fixes like replacing \logging.Logger\ with \getLogger\ (LOG001) or removing \exc\_info\ outside handlers (LOG014).

_crates/ruff\_linter/src/rules/flake8\logging/rules · high confidence

Refactor flake8-type-checking internals and introduce runtime-ambiguous annotation support

The \flake8-type-checking\ rules have been restructured into dedicated modules (\helpers.rs\, \imports.rs\, \settings.rs\) to improve maintainability. A new \TypingReference\ enum and \RuntimeSemantics\ configuration allow the linter to distinguish between strictly runtime-required, typing-only, and now 'runtime-ambiguous' annotation contexts. This enables more precise handling of annotations in complex scenarios, such as those involving \\_\future\\_\ annotations, auto-quoting, and specific base classes or decorators, while preserving existing behaviors for quoting and exempt modules.

_crates/ruff\_linter/src/rules/flake8\_type\checking · medium confidence

Refactor flake8\_2020 lint rules to use derive macros and split logic into dedicated modules

The \flake8\2020\ lint rules (YTT\) have been restructured to use the \ViolationMetadata\ derive macro and \derive\_message\_formats\ for consistent rule registration and error messaging. The rule implementations, previously likely monolithic, are now split into specific modules (\compare.rs\, \subscript.rs\, \name\_or\_attribute.rs\) handling distinct comparison patterns (e.g., \sys.version\ string comparisons, \sys.version\_info\ integer checks, and \six.PY3\ usage). This change improves maintainability and ensures that diagnostics are generated using the new unified helper infrastructure, while preserving the existing behavior of detecting Python 2/3 compatibility issues.

_crates/ruff\_linter/src/rules/flake8\2020/rules · high confidence

Refactor pep8-naming rule internals and settings

The pep8-naming rule module has been restructured to improve maintainability and configuration flexibility. A new \helpers.rs\ file extracts shared logic for detecting specific Python constructs, including named tuples, TypedDicts, TypeVars, NewTypes, TypeAliases, and dynamic Django model imports, reducing duplication across individual rule implementations. Additionally, the module now exposes a dedicated \Settings\ struct that allows users to configure \ignore\_names\ patterns (supporting both default pytest fixtures and custom glob patterns via \extend-ignore-names\) and define custom \classmethod\_decorators\ and \staticmethod\_decorators\, enabling more precise control over naming violations for these specific method types.

_crates/ruff\_linter/src/rules/pep8\naming · high confidence

Refactor printer internals to use slice-based queues and stacks

The printer implementation has been refactored to replace previous data structures with slice-based queues and stacks. This change introduces a new \PrintQueue\ and \FitsQueue\ that operate on slices of \FormatElement\ rather than individual allocations, and a \StackedStack\ that allows non-destructive iteration over stack frames. These internal optimizations reduce memory allocations and improve performance during the formatting process without altering the public API or the resulting formatted output.

_crates/ruff\formatter/src/printer · high confidence

Refactor pyupgrade rule infrastructure and add import-removal helper

The pyupgrade module has been restructured to improve maintainability and fix specific linting behaviors. A new \remove\_import\_members\ helper was added to \fixes.rs\ to correctly reconstruct \from ... import\ statements when removing specific members, handling edge cases like aliases, parenthesized imports, and multiline formatting. Helper functions \curly\_escape\ and \curly\_unescape\ were introduced in \helpers.rs\ to safely manage curly braces in string formatting contexts, preventing false positives in rules like \UP032\. The module now exposes a \Settings\ struct with a \keep\_runtime\_typing\ option, allowing users to control whether typing imports are preserved. Additionally, a \Primitive\ type was added to \types.rs\ to standardize the identification of Python primitive types across various pyupgrade rules.

_crates/ruff\linter/src/rules/pyupgrade · high confidence

Refactored flake8-return rule analysis infrastructure

The internal implementation of the flake8-return rules has been restructured to improve code organization and maintainability. This change introduces a dedicated \ReturnVisitor\ to handle AST traversal and state tracking (such as return statements, assignments, and annotations), extracts helper functions for logic like checking for non-None return values and determining statement boundaries, and defines a new \Branch\ enum to represent elif/else contexts. These structural improvements support the existing rules (RET501-RET508) without altering their external behavior or diagnostic output.

_crates/ruff\_linter/src/rules/flake8\return · high confidence

Refactored system abstraction with dedicated command execution and memory file system

The \ruff\_db::system\ module has been restructured to separate concerns: command execution is now handled by a new \Command\ struct and \CommandExecutor\ trait (in \command.rs\), allowing for isolated environment and working directory configuration. A new \MemoryFileSystem\ implementation (in \memory\_fs.rs\) provides an in-memory file system for testing, while \OsSystem\ (in \os.rs\) wraps the real OS file system. The \TestSystem\ (in \test.rs\) now supports environment variable overrides for test isolation. Path handling is abstracted via \SystemPath\ (in \path.rs\), and directory walking is managed by a new \WalkDirectoryBuilder\ (in \walk\_directory.rs\) with incremental ignore support.

_crates/ruff\db/src/system · high confidence

Refurb linter rules consolidated and stabilized

The \refurb\ linter module has been reorganized into a unified structure, introducing a shared \helpers.rs\ module to centralize logic for file I/O operations (such as \read-whole-file\ and \write-whole-file\) and identity checks. This consolidation supports the stabilization of preview behaviors for rules like \FURB169\ and ensures consistent handling of Python version-specific features, such as the \newline\ argument in \open()\ calls for Python 3.10+ and 3.13+. Users benefit from a more maintainable rule set with improved fix safety and broader coverage across the \refurb\ rule family.

_crates/ruff\linter/src/rules/refurb · high confidence

Reimplemented pycodestyle whitespace rules using a token-based logical line checker

The pycodestyle whitespace rules (including E201–E203, E221–E228, E251–E252, E261, E271–E275, E502, and comment spacing) have been rewritten to operate on a new token-based \LogicalLine\ abstraction. This change improves accuracy for complex syntax by correctly handling f-strings, type parameters, and soft keywords, while ensuring all affected rules now provide safe, automatic fixes for users.

_crates/ruff\_linter/src/rules/pycodestyle/rules/logical\lines · high confidence

Removal of unused wildcard import in test source

The test source file foo.py has been removed, eliminating an unused wildcard import from the bar module. This cleanup reduces potential namespace pollution and improves code clarity in the test sources.

_test\sources · high confidence

Reworked flake8-comprehensions rules with improved fixes and safety markings

The flake8-comprehensions linting rules have been restructured to provide more accurate and safer automatic fixes. Key behavioral changes include: C413 now correctly marks fixes for \reversed(sorted(...))\ as unsafe due to stability differences, while \list(sorted(...))\ remains safe; C419 now supports \min\, \max\, and \sum\ in preview mode, detecting unnecessary list/set comprehensions passed to these functions; C420 handles edge cases like attribute/subscript assignment targets and preserves whitespace; C400 and C401 now correctly strip parentheses around generators and handle trailing commas; C409 avoids incorrect tuple transformations for single-element cases and preserves trailing commas; C417 skips lambdas with \yield\, positional-only parameters, or different arity, and detects overshadowed builtins; C416 skips comprehensions containing unpacking; C408 removes the CST-based fixer; and C419 ignores async comprehensions and set comprehensions for \sum\. These changes improve fix reliability and reduce false positives across the suite.

_crates/ruff\_linter/src/rules/flake8\comprehensions/rules · high confidence

Ruff CLI restructured into the \`ruff\` crate with new argument parsing and cache serialization

The Ruff command-line interface has been reorganized into the \crates/ruff\ crate, introducing a new \args.rs\ module that defines the CLI structure using \clap\ (including global options like \--config\, \--isolated\, and \--color\, and subcommands such as \Check\, \Format\, \Server\, and \Analyze\). The cache system (\cache.rs\) has been updated to use \rkyv\ for serialization instead of the previous format, and includes logic to respect default Unix permissions for cache files. The core linting logic (\diagnostics.rs\, \lib.rs\) now integrates with \ruff\_db\ for diagnostic handling and supports reading from standard input, while the printer (\printer.rs\) provides updated output formatting for violations and fix summaries.

crates/ruff/src · high confidence

Ruff linter restructures and updates Pandas vet rules

The Pandas vet rules in the linter have been reorganized into individual source files (assignment\_to\_df, attr, call, inplace\_argument, nunique\_constant\_series\_check, pd\_merge, read\_table, subscript) and updated to use the new \ViolationMetadata\ derive macro. The \PD901\ rule (pandas-df-variable-name) has been removed as it was considered overly strict. Several existing rules have been refined: \PD002\ (inplace argument) now limits diagnostics to methods that actually accept an inplace argument; \PD011\ (use of .values) now suggests \.array\ in addition to \.to\_numpy()\; and \PD007\ (use of .ix) now includes a \Deprecated\ diagnostic tag.

_crates/ruff\_linter/src/rules/pandas\vet/rules · high confidence

Ruff macros crate restructured with new derive macros and internal utilities

The \ruff\_macros\ crate has been reorganized to provide a comprehensive suite of internal procedural macros for the Ruff ecosystem. This includes new derive macros such as \OptionsMetadata\ for configuration documentation, \CombineOptions\ and \Combine\ for merging configuration structs, and \CacheKey\ for generating cache keys with support for ignoring specific fields. The crate also introduces \ViolationMetadata\ for rule status and category tracking, \RuleNamespace\ for parsing rule codes, and \derive\_message\_formats\ for extracting message strings. Additionally, utility macros like \newtype\_index\ for efficient indexing, \map\_codes\ for rule registration, and \attribute\_env\_vars\_metadata\ for environment variable documentation have been added, alongside helper functions like \kebab\_case\ for identifier formatting.

_crates/ruff\macros · high confidence

Stabilize DTZ901 rule for datetime.min/max usage

The DTZ901 rule, which detects usages of \datetime.max\ and \datetime.min\, is now stabilized and included in the default linting suite. This change ensures that code patterns involving these specific datetime constants are consistently flagged as violations, helping users avoid potential issues with timezone-naive or extreme datetime values.

_crates/ruff\_linter/src/rules/flake8\datetimez · high confidence

Stabilize FA102 for additional PEP 585-compatible APIs

The \flake8-future-annotations\ rule FA102 is now stabilized and expanded to detect a broader set of PEP 585-compatible generic types, including \asyncio.Future\, \asyncio.Task\, \collections.deque\, \collections.defaultdict\, \collections.OrderedDict\, \collections.Counter\, \collections.ChainMap\, \contextlib.AbstractContextManager\, \contextlib.AbstractAsyncContextManager\, \dataclasses.Field\, \functools.cached\property\, \functools.partialmethod\, and \os.PathLike\. When these types are used without \from \\future\\_ import annotations\, Ruff now suggests adding the import to simplify the code.

_crates/ruff\_linter/src/rules/flake8\_future\_annotations, crates/ruff\_linter/src/rules/flake8\_future\annotations/snapshots · high confidence

Stabilize and expand flake8-pyi lint rules with autofixes

This update stabilizes several \flake8-pyi\ rules and introduces new ones, providing automated fixes for common stub file issues. \PYI016\ (duplicate-union-member) is now stable and always fixable, including support for \Optional\ types. \PYI019\ (custom-type-var-for-self) is stabilized with a fix that replaces custom TypeVars with \Self\, respecting local subclasses and avoiding metaclasses. \PYI034\ (future-annotations-in-stub) is stabilized with an autofix. New rules include \PYI032\ (any-eq-ne-annotation) to replace \Any\ with \object\ in \\_\eq\\\/\\\ne\\_\, \PYI057\ (bytestring-usage) to flag deprecated \ByteString\, \PYI058\ (bad-generator-return-type) to suggest \Iterator\ over \Generator\, \PYI062\ (duplicate-literal-member) to remove duplicates in \Literal\ types, and \PYI066\ (bad-version-info-order) to enforce newer version branches first. \PYI006\ and \PYI066\ now apply to all Python file types in preview mode.

_crates/ruff\_linter/src/rules/flake8\pyi/rules · high confidence

Stabilize flake8-boolean-trap rules FBT001, FBT002, and FBT003

The flake8-boolean-trap lint rules are now stable. This location introduces the core rule implementations: FBT001 detects boolean-typed positional arguments in function definitions (including complex types like unions), FBT002 detects boolean default values in positional arguments, and FBT003 detects boolean positional values in function calls. All three rules exempt setters and methods decorated with @typing.override to respect the Liskov Substitution Principle, and FBT001/FBT002 allow explicitly whitelisted functions.

_crates/ruff\_linter/src/rules/flake8\_boolean\trap/rules · high confidence

Stabilize flake8-bugbear rules and refine fix safety

This change stabilizes several flake8-bugbear rules that were previously in preview, including \abstract-base-class\ (B024), \empty-method-without-abstract-decorator\ (B027), \cached-instance-method\ (B019), \class-as-data-structure\ (B903), and \batched-without-explicit-strict\ (B911). It also introduces new rules for \delattr\ with constant arguments (B043) and duplicate set values (B033). Additionally, fix safety is refined across multiple rules: fixes for \assert-false\ (B011), \delattr-with-constant\ (B043), and \duplicate-value\ (B033) are marked unsafe when they would remove comments or alter NFKC normalization, while \duplicate-try-block-exception\ (B014) is marked unsafe if comments are present.

_crates/ruff\_linter/src/rules/flake8\bugbear/rules · high confidence

Stabilize flake8-simplify rules and remove preview gating

The \flake8-simplify\ linting rules are now stable and no longer require preview mode to be enabled. This change removes the preview gating for these rules, making them available by default in standard configuration. The module now includes test cases for a comprehensive set of rules including SIM101, SIM102, SIM103, SIM105, SIM107, SIM108, SIM109, SIM110, SIM111, SIM112, SIM113, SIM114, SIM115, SIM116, SIM117, SIM118, SIM201, SIM202, SIM208, SIM210, SIM211, SIM212, SIM220, SIM221, SIM222, SIM223, SIM300, SIM401, SIM905, SIM910, and SIM911, ensuring consistent behavior across all supported Python versions.

_crates/ruff\_linter/src/rules/flake8\simplify · high confidence

Stabilize pygrep-hooks lint rules and remove deprecated redirects

The pygrep\_hooks rules are now stable and no longer require preview mode. This update stabilizes PGH004 (blanket-noqa), which now detects file-level noqa suppressions and suggests adding specific rule codes; PGH005 (invalid-mock-access), which now checks for uncalled or non-existent AsyncMock methods; and PGH003 (blanket-type-ignore), which flags type: ignore comments that suppress all warnings without specifying codes. Additionally, the deprecated PGH001 (no-eval) and PGH002 (deprecated-log-warn) rules have been marked as removed since v0.2.0, with users directed to use S307 and G010 respectively.

_crates/ruff\_linter/src/rules/pygrep\hooks/rules · high confidence

The CPY001 rule, which checks for the absence of copyright notices in Python files, is now stable. It scans the first 4096 bytes of a file for a notice matching the configured regular expression, optionally verifying the author if specified. Files smaller than the configured minimum file size are ignored.

_crates/ruff\_linter/src/rules/flake8\copyright/rules · high confidence

Tryceratops rules restructured with new TRY400 and TRY401 rules

The Tryceratops linting rules have been reorganized and expanded. A new rule, TRY400 (error\_instead\_of\_exception), now suggests using \logging.exception\ instead of \logging.error\ when logging exceptions, providing an auto-fix that is safe for the standard \logging\ module but marked unsafe for custom logger objects. Another new rule, TRY401 (verbose\_log\_message), detects redundant exception objects included in \logging.exception\ calls. Additionally, TRY200 (reraise\_no\_cause) has been deprecated in favor of B904, and TRY302 has been renamed to TRY203 (useless\_try\_except). The rule implementations have been updated to use the new \ViolationMetadata\ derive macro and the \Checker\ is now passed by immutable reference.

_crates/ruff\linter/src/rules/tryceratops/rules · high confidence

Unify flake8-logging rule infrastructure and helpers

The flake8-logging rule module now uses a shared \helpers.rs\ file containing utility functions like \outside\_handlers\ and \is\_logger\_method\_name\, replacing scattered inline logic. This refactoring unifies diagnostic handling and supports existing rules (LOG001, LOG002, LOG004, LOG007, LOG009, LOG014, LOG015) with cleaner, reusable code for detecting exception handler contexts and logger method names.

_crates/ruff\_linter/src/rules/flake8\logging · high confidence

Updated NumPy 2.0 migration snapshots for deprecated functions and types

The test snapshots for the NumPy 2.0 migration rules (NPY001, NPY002, NPY003, and NPY201) have been updated to reflect the current deprecation landscape. NPY001 now covers deprecated type aliases like \np.float\, \np.int\, \np.object\, and \np.complex\, suggesting replacements with Python builtins. NPY002 captures legacy random functions such as \np.random.standard\normal\ and \np.random.seed\, recommending migration to \np.random.Generator\. NPY003 identifies deprecated functions like \np.round\\, \np.product\, \np.sometrue\, and \np.alltrue\, providing fixes to their modern equivalents (\np.round\, \np.prod\, \np.any\, \np.all\). Finally, NPY201 snapshots include a broader set of removals in NumPy 2.0, such as \np.add\_docstring\, \np.byte\_bounds\, \np.cfloat\, \np.PINF\, \np.safe\_eval\, and various exception classes, with specific autofixes or migration paths provided where applicable.

_crates/ruff\linter/src/rules/numpy/snapshots · high confidence

Updated Pylint rule snapshots for new and modified diagnostics

The test snapshots for the Pylint rules have been updated to reflect new and modified diagnostic messages. This includes the addition of snapshots for rules such as PLR2004 (magic-value-comparison), PLW0129 (assert-on-string-literal), PLE1142 (await-outside-async), PLW3201 (bad-dunder-method-name), PLW1501 (bad-open-mode), PLW0211 (bad-staticmethod-argument), PLE1310 (bad-str-strip-call), PLE1300 (bad-string-format-character), PLE1307 (bad-string-format-type), PLE2502 (bidirectional-unicode), PLW0711 (binary-op-exception), PLR1716 (boolean-chained-comparison), PLR5501 (collapsible-else-if), PLC1901 (compare-to-empty-string), PLR0133 (comparison-of-constant), PLR0124 (comparison-with-itself), PLR1712 (conflict-with-definition-rules), PLE0116 (continue-in-finally), and PLC0206 (dict-index-missing-items). These changes ensure that the linting output for these specific Pylint rules matches the expected behavior and message formats.

_crates/ruff\linter/src/rules/pylint/snapshots · high confidence

Updated Python 3.15 builtins and standard library module lists

The \ruff\_python\stdlib\ crate now recognizes \frozendict\ and \sentinel\ as built-in types for Python 3.15, and includes \tomllib\ and \profiling\ in the known standard library modules for that version. Additionally, the \\\cached\\_\ magic global is no longer treated as available in Python 3.15, aligning Ruff's internal data with the upcoming Python release.

_crates/ruff\_python\stdlib · high confidence

Updated diagnostic snippet rendering examples

The examples in the vendored \ruff\_annotate\_snippets\ crate have been updated to reflect the latest \annotate-snippets\ library, introducing support for new rendering features such as error-code hyperlinks, source highlighting, and multi-patch suggestions.

_crates/ruff\_annotate\snippets/examples · high confidence

Updated flake8-comprehensions autofixes for Python 3.15 and preview rules

The flake8-comprehensions linter's autofixes for rules C400, C401, C402, C419, and C420 now support Python 3.15 unpacking syntax (e.g., \list(\*x for x in xs)\). Additionally, preview-mode fixes for C419 (unnecessary comprehension in call) have been updated to handle multi-line comprehensions and preserve comments more accurately.

_crates/ruff\_linter/src/rules/flake8\comprehensions/snapshots · high confidence

Updated flake8-executable test snapshots for EXE003 and EXE004

The test snapshots for the flake8-executable rules have been updated to reflect recent behavioral changes. The EXE003 rule (shebang-missing-python) now explicitly lists \pytest\ and \uv run\ as valid shebang interpreters in its help message, and the EXE004 rule (whitespace-before-shebang) marks its auto-fix as unsafe, warning users that the fix may change runtime behavior.

_crates/ruff\_linter/src/rules/flake8\executable/snapshots · high confidence

Updated flake8-pyi lint snapshots for PYI032, PYI014, PYI015, PYI036, PYI006, PYI066, PYI057, and PYI024

This change updates the expected diagnostic snapshots for several \flake8\pyi\ rules to reflect current linting behavior. For PYI032, the linter now suggests replacing \Any\ with \object\ for the second parameter of \\\eq\\\ and \\\ne\\\. PYI014 and PYI015 enforce that only simple default values are allowed for function arguments and assignments in stubs, suggesting \...\ as the replacement for complex defaults. PYI036 provides stricter checks for \\\exit\\\ and \\\aexit\\_\ annotations, requiring \object\ for star-args and validating argument types and counts. PYI006 restricts \sys.version\_info\ comparisons to \\<\ and \\>=\. PYI066 advises ordering \sys.version\_info\ branches with newer versions first. PYI057 warns against using the deprecated \typing.ByteString\ and \collections.abc.ByteString\. Finally, PYI024 snapshots are updated for named-tuple usage.

_crates/ruff\_linter/src/rules/flake8\pyi/snapshots · high confidence

Updated flake8-type-checking rule snapshots for import and quoting fixes

The test snapshots for the \flake8-type-checking\ rules have been updated to reflect new and corrected behaviors. The TC001, TC002, and TC003 rules now correctly handle \from \_\future\\_ import annotations\ by offering to convert typing-only imports to lazy imports (using \lazy from ...\ or \lazy import ...\) instead of always moving them into a \TYPE\_CHECKING\ block. The TC008 rule now provides fixes to remove unnecessary quotes from type aliases, including support for union syntax. Additionally, the TC004 rule's fix for moving runtime-used imports out of \TYPE\_CHECKING\ blocks has been refined to handle cases where the import is already quoted.

_crates/ruff\_linter/src/rules/flake8\_type\checking/snapshots · high confidence

Updated linter rule snapshots for Python 3.13–3.15 and new diagnostic behaviors

The test snapshots for the \ruff\ linter rules have been updated to reflect changes in diagnostic output and fix suggestions across several rules. For Python 3.13+, the \RUF036\ rule now correctly suggests moving \None\ to the end of type unions. The \RUF013\ rule (implicit \Optional\) now offers fixes that convert to \T \| None\ syntax and automatically add \from \_\future\\_ import annotations\ when beneficial. The \RUF015\ rule now suggests using \next()\ for single-element slices, and \RUF017\ suggests starred list comprehensions for quadratic list summation. Additionally, \RUF063\ now recommends \annotationlib.get\_annotations\ for Python 3.14+ and \typing\_extensions.get\_annotations\ for earlier versions, while \RUF005\ and \RUF030\ snapshots reflect refined suggestions for collection concatenation and \print()\ in assertions.

_crates/ruff\linter/src/rules/ruff/snapshots · high confidence

Updated pandas-vet rule snapshots for diagnostic and fix rendering

The test snapshots for the pandas-vet linter rules (PD002, PD003, PD004, PD007, PD008, PD009, PD010, PD011, PD012, PD013, PD015, PD901, PD101) have been updated to reflect the new diagnostic rendering format. This includes changes to how error messages, code snippets, and fix suggestions are displayed to users, ensuring consistency with the latest output standards in the linter.

_crates/ruff\_linter/src/rules/pandas\vet/snapshots · high confidence

Updated perflint rule snapshots for improved code fixes

The perflint rule snapshots have been updated to reflect improved behavior in several linter rules. The PERF102 rule now provides more accurate suggestions for replacing \.items()\ with \.keys()\ or \.values()\ when only one is used, handling complex unpacking patterns. The PERF401 rule now offers fixes for converting manual list-appending loops into list comprehensions or \list.extend\ calls, including support for async comprehensions. The PERF403 rule now suggests replacing manual dictionary-building loops with dictionary comprehensions or \dict.update\. Additionally, new snapshots were added for PERF101 (removing unnecessary \list()\ casts) and PERF203 (detecting \try\-\except\ blocks inside loops).

_crates/ruff\linter/src/rules/perflint/snapshots · high confidence

Updated vendored annotate-snippets library with new diagnostic API

The \ruff\_annotate\_snippets\ crate has been updated to vendor a newer version of the \annotate-snippets\ library. This update introduces a redesigned API for constructing diagnostic reports, featuring new \Level\ constants (ERROR, WARNING, INFO, NOTE, HELP) and methods like \primary\_title\ and \secondary\_title\ for building structured \Report\ entries. The change also adds support for customizing level names via \with\_name\ and hiding level headers, allowing for more flexible and cleaner diagnostic output in the CLI.

_crates/ruff\_annotate\snippets/src · high confidence

Updated vendored typeshed stubs with local patches for dict and dataclass\_transform

The vendored typeshed stubs have been updated to a new source commit (b932d8ce) and include several local patches to improve type-checking accuracy. \dict.get\, \dict.pop\, and \Mapping.get\ overloads now accept arbitrary keys (using \object\ instead of the strict key type) when a default value is provided, preventing false positives for non-standard key types. The \dataclass\_transform\ decorator now explicitly supports the \slots\_default\ parameter. Additionally, the build process now packages custom \ty\_extensions\ stubs (including Pydantic lax-mode input types and special forms like \TypeOf\ and \Intersection\) directly into the typeshed zip archive.

_crates/ty\vendored · high confidence

flake8-boolean-trap: Add user-configurable allowed calls and stabilize FBT001

The flake8-boolean-trap rules now support a new \extend\_allowed\calls\ setting, allowing users to explicitly whitelist specific function calls (e.g., \django.db.models.Value\, \pydantic.Field\) from triggering boolean trap violations. Additionally, the \FBT001\ rule (boolean type hint in positional arguments) has been stabilized, and the linter now correctly excludes boolean operators and allows boolean positionals in \\\_post\init\\_\ and setter methods by default.

_crates/ruff\_linter/src/rules/flake8\_boolean\trap · high confidence

The flake8-copyright linter rule has been updated to accept the Unicode copyright symbol (©) in addition to the ASCII (C) notation, and now supports an optional \author\ configuration setting to validate specific copyright holders. These changes are reflected in the new \flake8\_copyright\ module within the \ruff\_linter\ crate, which includes updated settings for the notice regex and author validation, along with corresponding tests for various copyright notice formats.

_crates/ruff\_linter/src/rules/flake8\copyright · high confidence

flake8-errmsg plugin settings and tests relocated to ruff\_linter

The configuration and test infrastructure for the flake8-errmsg linter rules (EM101, EM102, EM103) have been moved into the new ruff\_linter crate. This change introduces a dedicated settings module allowing users to configure the \max\_string\_length\ parameter for these rules, and establishes the corresponding test suite to validate default and custom configurations.

_crates/ruff\_linter/src/rules/flake8\errmsg · high confidence

flake8-errmsg rules now support byte strings in EM101

The \flake8-errmsg\ linter rules (specifically EM101) have been extended to detect and flag the use of byte strings in exception constructors, in addition to regular strings and f-strings. This change ensures that byte string literals used directly in \raise\ statements are also flagged as they duplicate information in tracebacks, and the linter now provides an autofix to assign the byte string to a variable first.

_crates/ruff\_linter/src/rules/flake8\errmsg/rules · high confidence

flake8-gettext rules now resolve qualified names and built-in bindings

The flake8-gettext linter rules (INT001, INT002, INT003) now correctly identify internationalization function calls even when they are accessed via qualified names (e.g., \module.ngettext\) or bound to built-in names. This change improves detection accuracy for gettext usage patterns that were previously missed, ensuring that f-strings, format strings, and printf-style strings inside these functions are flagged consistently regardless of how the function is referenced in the code.

_crates/ruff\_linter/src/rules/flake8\gettext · high confidence

flake8-pytest-style rules now use a dedicated settings module with configurable defaults

The \flake8-pytest-style\ plugin now exposes a structured \Settings\ configuration (in \settings.rs\) that allows users to control rule behavior via options such as \fixture\_parentheses\, \mark\_parentheses\, and the expected types for \@pytest.mark.parametrize\ arguments (\parametrize\_names\_type\, \parametrize\_values\_type\, \parametrize\_values\_row\_type\). The default for \parametrize\_names\_type\ has changed from \Csv\ to \Tuple\, and the default for \parametrize\_values\_type\ is now \List\ (previously \Tuple\), meaning the linter will now expect \parametrize\ calls to use lists of tuples by default rather than tuples of tuples. Additionally, the plugin now supports checking \pytest\_asyncio\ fixtures when the corresponding preview feature is enabled.

_crates/ruff\_linter/src/rules/flake8\_pytest\style · high confidence

flake8-quotes rules now support unnecessary escaped quote detection

The flake8-quotes linter rules have been updated to include detection for unnecessary escaped quotes (UnnecessaryEscapedQuote). This change introduces new helper functions to identify and handle escaped quotes within strings, allowing the linter to flag cases where quotes are escaped unnecessarily. Users can now benefit from more precise linting that helps maintain cleaner and more readable code by avoiding redundant escape sequences.

_crates/ruff\_linter/src/rules/flake8\quotes · high confidence

isort rule rewritten with new modular architecture

The isort rule implementation has been completely rewritten to use a new modular architecture, introducing dedicated modules for annotating imports (annotate.rs), identifying import blocks (block.rs), categorizing imports (categorize.rs), handling comments (comments.rs), formatting output (format.rs), and ordering imports (order.rs). This refactoring changes how the linter processes import statements, including improved handling of comments, lazy imports, and import block boundaries, which may alter the specific ordering or formatting of imports in existing codebases.

_crates/ruff\linter/src/rules/isort · high confidence

pycodestyle plugin settings and line-length handling

The pycodestyle rules module now exposes a dedicated settings struct with configurable \max\_line\_length\, \max\_doc\_length\, and \ignore\_overlong\_task\_comments\ options. The \overlong.rs\ module implements line-length measurement that excludes trailing pragma comments (like \\# type: ignore\) and task comments (like \\# TODO\) from the width calculation, while also exempting SPDX license headers and lines ending with URLs. A new \helpers.rs\ module provides utility functions for identifying ambiguous names and non-logical tokens.

_crates/ruff\linter/src/rules/pycodestyle · high confidence

Test coverage

Add inline test suite for parser syntax errors; Add integration tests for Python trivia parsing; Add snapshot tests for annotated snippet rendering; Added integration tests for Ruff CLI commands; Added multi-package test fixture for settings resolution; Added snapshot tests for F401 rule documentation and JSON output; Added test fixture for flake8-fixme rules; Added test fixture for import aliasing in \_\init\\_.py; Added test fixture for private built-in module exemption; Added test fixtures for A005 module shadowing in package context; Added test fixtures for COM81 and syntax error handling; Added test fixtures for FLY002 f-string conversion rules; Added test fixtures for FastAPI linting rules FAST001, FAST002, and FAST003; Added test fixtures for NumPy 2.0 migration rules; Added test fixtures for Pylint rules; Added test fixtures for Python syntax error detection; Added test fixtures for RSE102 (unnecessary parentheses on raise); Added test fixtures for cache, formatting, and include tests; Added test fixtures for flake8-annotation rules; Added test fixtures for flake8-blind-except (BLE) rules; Added test fixtures for flake8-builtins A005 module shadowing checks; Added test fixtures for flake8-builtins rules A001, A002, A003, A004, and A006; Added test fixtures for flake8-debugger T100 rule; Added test fixtures for flake8-future-annotations edge cases; Added test fixtures for flake8-gettext rules INT001, INT002, and INT003; Added test fixtures for flake8-no-pep420 rule scenarios; Added test fixtures for flake8-pie rules PIE790, PIE794, PIE796, PIE800, PIE804, PIE807, PIE808, and PIE810; Added test fixtures for flake8-print rules T201 and T203; Added test fixtures for flake8-slots rules (SLOT000, SLOT001, SLOT002); Added test fixtures for flake8-tidy-imports rules TID251–TID255; Added test fixtures for flake8-todos rules TD001–TD007; Added test fixtures for flake8-type-checking module scenarios; Added test fixtures for isort required imports; Added test fixtures for linter rules and package scanning; Added test fixtures for pandas vet rules PD002, PD101, and read\_table usage; Added test fixtures for pydoclint rules DOC102, DOC201, DOC202, DOC402, DOC403, DOC501, and DOC502; Added test fixtures for semantic syntax errors; Added test fixtures for the import-private-name (PLC2701) rule; Added test infrastructure files for the linter; Added tests for CacheKey derive macro; Airflow linter snapshot tests updated for Airflow 3.0 migration rules; Establishes test harness for flake8-pie rules in ruff\_linter; Expanded isort test fixtures for import sorting behavior; Expanded pycodestyle test fixtures for whitespace, indentation, and import rules; Expanded pydocstyle test fixtures for rule coverage; Expanded test coverage for flake8-self (SLF001) edge cases; Expanded test coverage for flake8-type-checking rules; Expanded test coverage for perflint rules (PERF101, PERF102, PERF203, PERF401–403); Expanded test fixtures for ERA001 (eradicate) rule; Expanded test fixtures for RUF rules; Expanded test fixtures for flake8-bandit security rules; Expanded test fixtures for flake8-boolean-trap rule; Expanded test fixtures for flake8-bugbear linter rules; Expanded test fixtures for pyflakes lint rules; Expanded test fixtures for pyupgrade linting rules; New CLI test infrastructure and expanded test coverage; New integration test suite for ruff\_python\_ast; New pycodestyle rule snapshots for ambiguous names and blank lines; New test fixtures for Airflow linting rules AIR001–AIR302; Snapshot tests for CLI output formats; Snapshot tests for version string formatting and serialization; Snapshot updates for flake8-boolean-trap rule tests; Snapshot updates for flake8-logging-format rules; Snapshot updates for pydocstyle rules D420, D417, and others; Updated SLF001 snapshot tests for private member access diagnostics; Updated Tryceratops rule snapshots for TRY002, TRY003, TRY004, TRY201, TRY203, TRY300, TRY301, TRY400, and TRY401; Updated flake8-annotations test snapshots for auto-return-type inference; Updated flake8-async lint snapshots for ASYNC109, ASYNC115, and other rules; Updated flake8-bandit snapshot tests for diagnostic output; Updated flake8-commas test snapshots for COM812 and COM819 rules; Updated flake8-gettext lint snapshots for INT001, INT002, and INT003; Updated flake8-import-conventions test snapshots for ICN001 and ICN002 rules; Updated flake8-pytest-style rule snapshots; Updated flake8-quotes test snapshots for docstring quote enforcement; Updated isort snapshot tests for import sorting behavior; Updated pyflakes test snapshots for F401, F811, and F821 rule behaviors; Updated pyupgrade rule snapshots for UP001–UP013; Updated snapshot for ERA001 commented-out code detection; Updated snapshot tests for McCabe complexity rule; Updated snapshot tests for flake8-fixme diagnostics; Updated snapshot tests for flake8-implicit-str-concat rules; Updated snapshot tests for flake8-no-pep420 rule; Updated test fixtures for flake8-pytest-style rules; Updated test snapshots for flake8-use-pathlib rules; flake8-bugbear snapshot updates for multiple rules; flake8-pyi test suite now validates rules against both .py and .pyi files; pygrep-hooks rule tests now use LinterSettings and support preview mode.

Dependencies

2818 commits updating dependencies (116 manifests)

A dependency / build maintenance change in (dependencies) — 2818 commits (86 fixs), 116 files: “\[red-knot\] Allow module-resolution options to be specified via the CLI (\#12246)”; “\[ty\] Parse Google docstrings for parameter docs (\#25919)”; “\[ty\] Add panic-by-default await methods to \TestServer\ (\#21451)”; and 2813 more (refs \#12246, \#25919, \#21451, \#4191, \#20514, …).

(dependencies) · high confidence · unverified

Ruff 0.17.0 release

This release updates the \ruff\_python\_ast\ crate to version 0.0.17, corresponding to the Ruff 0.17.0 release. The crate now includes a generated README and an \ast.toml\ configuration file that defines the Python AST data model used for auto-generating Rust syntax nodes.

_crates/ruff\_python\ast · high confidence

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 59 → 61 (+2.1)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.4) — scores are not directly comparable.

Lenses

  • Code Health 52 → 51 (-0.4)
  • Architecture 97 → 97 (-0.3)
  • Maturity 76 → 78 (+1.7)
  • Readiness 80 → 80 (+0.7)
  • Security 77 → 74 (-2.8)
  • Event Sourcing 100 → 100 (+0.0)
  • Accessibility 50 → 59 (+9.0)
  • Performance 94 → 94 (+0.0)

Resolved (365)

  • CallInference::infer (cognitive 33) (crates/ty_python_semantic/src/types/call/bind.rs)
  • CallInference::infer (cyclomatic 21) (crates/ty_python_semantic/src/types/call/bind.rs)
  • CallInference::refined_return_type (cognitive 24) (crates/ty_python_semantic/src/types/call/bind.rs)
  • CallInference::refined_return_type (cyclomatic 17) (crates/ty_python_semantic/src/types/call/bind.rs)
  • CallInference::solve (cognitive 16) (crates/ty_python_semantic/src/types/call/bind.rs)
  • CallInference::specialized_return_type (cognitive 17) (crates/ty_python_semantic/src/types/call/bind.rs)
  • Change coupling: assertion.rs ↔ lib.rs (crates/mdtest/src/assertion.rs)
  • Change coupling: lint.rs ↔ format.rs (crates/ruff_server/src/lint.rs)
  • ClassTooLong: ConstraintSetStorage (crates/ty_python_semantic/src/types/constraints.rs)
  • Duplicated block (10 lines × 2) (crates/ruff_linter/src/rules/airflow/rules/runtime_value_in_dag_or_task.rs)
  • Duplicated block (10 lines × 2) (crates/ruff_linter/src/rules/flake8_annotations/rules/definition.rs)
  • Duplicated block (10 lines × 2) (crates/ruff_linter/src/rules/refurb/rules/read_whole_file.rs)
  • Duplicated block (10 lines × 2) (crates/ruff_python_formatter/src/statement/stmt_class_def.rs)
  • Duplicated block (10 lines × 2) (crates/ruff_python_parser/src/lexer/cursor.rs)
  • Duplicated block (10 lines × 2) (crates/ruff_server/src/server.rs)
  • Duplicated block (10 lines × 2) (crates/ruff_workspace/src/resolver.rs)
  • Duplicated block (10 lines × 2) (crates/ty_python_semantic/src/types/bound_super.rs)
  • Duplicated block (10 lines × 2) (crates/ty_python_semantic/src/types/call/bind.rs)
  • Duplicated block (10 lines × 2) (crates/ty_python_semantic/src/types/infer/builder.rs)
  • Duplicated block (10 lines × 2) (crates/ty_python_semantic/src/types/infer/builder.rs)
  • …and 345 more

New (943)

  • ArgumentTypeChecker::evaluate_paramspec_sub_call (cyclomatic 17) (crates/ty_python_semantic/src/types/call/bind.rs)
  • Binding::argument_type_context (cyclomatic 18) (crates/ty_python_semantic/src/types/call/bind.rs)
  • CallInference::infer_legacy (cognitive 29) (crates/ty_python_semantic/src/types/call/bind.rs)
  • CallInference::infer_legacy (cyclomatic 17) (crates/ty_python_semantic/src/types/call/bind.rs)
  • CallInference::intersect_specialized_returns (cognitive 22) (crates/ty_python_semantic/src/types/call/bind.rs)
  • CallInference::select_return_type (cognitive 29) (crates/ty_python_semantic/src/types/call/bind.rs)
  • CallInference::select_return_type (cyclomatic 24) (crates/ty_python_semantic/src/types/call/bind.rs)
  • CandidateSolutions::promote_for_argument_context (cognitive 24) (crates/ty_python_semantic/src/types/constraints.rs)
  • CandidateSolutions::promote_for_argument_context (cyclomatic 16) (crates/ty_python_semantic/src/types/constraints.rs)
  • Change coupling: check.rs ↔ test.rs (crates/ruff/src/commands/check.rs)
  • Change coupling: source.rs ↔ infer.rs (crates/ruff_db/src/source.rs)
  • ClassTooLong: CandidateSolutions (crates/ty_python_semantic/src/types/constraints.rs)
  • ClassTooLong: ContextCursor (crates/ty_ide/src/completion.rs)
  • ClassTooLong: UnionType (crates/ty_python_semantic/src/types/set_theoretic.rs)
  • ComparableExpr::eq (cognitive 63) (crates/ruff_python_ast/src/comparable.rs)
  • ComparableExpr::eq (cyclomatic 64) (crates/ruff_python_ast/src/comparable.rs)
  • ComparablePattern::eq (cognitive 17) (crates/ruff_python_ast/src/comparable.rs)
  • ComparablePattern::eq (cyclomatic 16) (crates/ruff_python_ast/src/comparable.rs)
  • ComparableStmt::eq (cognitive 45) (crates/ruff_python_ast/src/comparable.rs)
  • ComparableStmt::eq (cyclomatic 47) (crates/ruff_python_ast/src/comparable.rs)
  • …and 923 more

Changes since last survey

  • 300 commits — 268 feature/other, 32 fixes

By area

  • crates/ty_python_semantic — 119 commits
  • crates/ruff_linter — 42 commits
  • (root) — 27 commits
  • .github/workflows — 23 commits
  • crates/ty — 14 commits
  • crates/ty_python_core — 10 commits
  • scripts/ty_benchmark — 7 commits
  • crates/ty_ide — 6 commits
  • crates/ruff_benchmark — 5 commits
  • crates/ty_project — 5 commits
  • crates/ruff_db — 4 commits
  • crates/ruff — 3 commits
  • crates/ruff_python_formatter — 3 commits
  • python/py-fuzzer — 3 commits
  • .github/automations-dispatch.json — 2 commits
  • crates/ruff_formatter — 2 commits
  • crates/ruff_notebook — 2 commits
  • crates/ruff_python_parser — 2 commits
  • crates/ruff_python_semantic — 2 commits
  • crates/ty_server — 2 commits

Notable commits

  • fix: Fix FreeBSD source builds with libc 0.2.190 (#30176)
  • fix: Fix Python 3.15 startup for mdtest.py and py-fuzzer (#30213)
  • fix: Fix fixes that add or remove a keyword argument with a parenthesized value (#30189)
  • fix: Fix panic on BOM-prefixed files in diagnostic renderer (#30017)
  • fix: Fix stale syn references in Cargo.lock (#30321)
  • fix: Fix transparent context menus in the Ruff and ty playgrounds (#30060)
  • fix: Refine AGENTS.md guidance on regression coverage and code comments (#30263)
  • fix: Revert "Use the report destination to color ruff check diagnostics" (#29908)
  • fix: Show more nonprinting characters in diagnostic fix diffs (#30062)
  • fix: Update playground Wrangler to 4.153.0 for undici security fixes (#30265)
  • fix: [flake8-logging-format] Avoid behavior changes and syntax errors in fixes (G004) (#27419)
  • fix: [flake8-logging-format] Mark G004 fix as unsafe (#30087)
  • fix: [refurb] Do not offer fix when write is nested in an expression (FURB103) (#29789)
  • fix: [flake8-bugbear] Fix B010 autofix for parenthesized setattr calls (#30168)
  • fix: [flake8-pyi] Fix PYI034 autofix for parenthesized self annotations (#30173)
  • fix: [pyupgrade] Fix UP031 duplicating closing parentheses around the format string (#30172)
  • fix: [ty] Add a regression test for a type alias cycle in a class decorator (#29926)
  • fix: [ty] Add a regression test for an enum class passed to a generic union parameter (#29931)
  • fix: [ty] Avoid spurious syntax warnings when applying fixes (#30404)
  • fix: [ty] Fix a call hierarchy panic when expanding outgoing calls (#29964)
  • …and 280 more

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

astral-sh/ruff was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 14 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit b140af2f48bddf33a1ae984174af3180236aaaaf — the exact code this score is about.
  • Scored under rubric-2026.11.4 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.65+preprod-36d4cd83012f.