Skip to content

Remove the vendored Ruff repository from the formatter dependency chain #139

Open

Description

@JuroOravec

Problem

Citry vendors Ruff 0.16.6 at commit
22f65a2ab5052990503985c7c794de37598d531e as the complete
third_party/rust/ruff git submodule so the template formatter can parse,
format, and compare embedded Python expressions in-process. The workspace
declares 16 ruff_* crates plus ty_static by local path. The formatter
directly imports five, and Cargo resolves the rest of the dependency closure.

This makes Ruff a large repository-level dependency and requires Citry to
follow Ruff's workspace toolchain and internal crate changes. The current
third-party dependency note says a Cargo git dependency previously failed,
but it does not record the attempted dependency shape or show whether the
obstacle still exists.

Goal

Remove third_party/rust/ruff while preserving the current in-process
formatting behavior, reproducible builds, and semantic verification.

Investigation

  • Reduce Citry's actual use to the smallest required Ruff API and crate closure.
  • Reproduce and document why pinned Cargo git dependencies do or do not work with the current Ruff workspace.
  • Check whether the required crates are now published independently or whether Ruff offers a supported library API for parsing and formatting Python expressions.
  • Identify the smallest upstream change that would unblock Citry: published crates, a supported facade crate, feature separation, or another stable embedding boundary.
  • Open focused Ruff upstream issues or pull requests after checking their contribution guidance and existing work.
  • Track upstream releases containing accepted changes.

Migration

  • Replace every third_party/rust/ruff path dependency in the root Cargo.toml with the selected pinned upstream dependency.
  • Remove the Ruff git submodule and its .gitmodules entry.
  • Update bootstrap, contributor and dependency documentation.
  • Preserve provider identity/version reporting and lockfile reproducibility.
  • Run the template formatter's Python-expression corpus, fixed-point checks, AST/comment equivalence checks, Python binding tests, CLI tests and editor cross-surface tests.

Acceptance criteria

  • Citry no longer stores or initializes third_party/rust/ruff.
  • A clean checkout can build the formatter without initializing or storing a
    vendored Ruff checkout or submodule.
  • The dependency is pinned and represented fully in Cargo.lock.
  • Embedded Python formatting output and all semantic-safety checks remain unchanged, unless a separately reviewed formatter change documents the difference.
  • Any required upstream contract is released or pinned to a reviewed immutable revision, with a follow-up path to a normal release.

Activity

  1. added
    next-sprint
    on Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    next-sprint

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions