This repository contains the Ruff Python linter and formatter, along with the Ty Python type checker, both written in Rust. It is a monolith of several dozen crates assembled into a workspace, delivering a CLI tool, a Language Server Protocol (LSP) server, and a web playground. In production, Ruff analyzes Python source files against hundreds of lint rules from flake8, pylint, pyupgrade, and other plugins, formats code to be compatible with Black, and provides IDE features via LSP. Ty adds type checking and advanced IDE features like goto-definition and workspace symbols. The architecture is modular: a parser produces an AST, semantic analysis operates on that AST, lint rules are checked via pluggable visitors, formatting is done through an IR-based printer, and diagnostics are rendered in multiple formats (JSON, JUnit, SARIF, etc.). The LSP server reuses many of these components through a Salsa-based incremental database for caching. The repository is a model of how to structure a high-performance developer tool in Rust, with extensive test fixtures, fuzzing, and benchmarks. While primarily an application, it includes some data-like assets (test fixture corpora, ecosystem check scripts) but nothing that would classify it as a data research project.
Black is the uncompromising Python code formatter. It is a CLI tool that automatically reformats Python source code to a consistent style, with a focus on determinism and minimal configuration. The repository contains the core formatting engine, a HTTP server (blackd) for on-demand formatting, a GitHub Action for CI integration, and a Vim plugin. The architecture is modular: parsing uses a forked lib2to3 parser (blib2to3) for lenient syntax handling, then a visitor-based line generator produces formatted lines, with specialized transformers for strings, brackets, and comments. It supports Jupyter notebooks, line-range formatting, caching, and parallel execution. The codebase is exceptionally well-tested with hundreds of edge-case test files and a comprehensive test suite. It demonstrates high craftsmanship in areas like tree manipulation, concurrency patterns, and string normalization.
This repository serves as a pre-commit hook configuration for Ruff, an extremely fast Python linter and formatter. It defines three pre-commit hooks: `ruff-check`, `ruff-format`, and a legacy `ruff` alias. The core operational code is a single Python script (`mirror.py`) that automates version mirroring: it fetches the latest Ruff release from PyPI and updates version strings in `pyproject.toml` and `README.md`. A GitHub Actions workflow runs this script on a schedule (every 4 hours), commits changes, tags releases, and creates GitHub releases. The repository is a minimal, well-structured wrapper that enables installing Ruff via pre-commit hooks. There is no application logic beyond the mirror script; the project's value is in its configuration and automation pipeline for staying in sync with upstream Ruff releases.
This repository is the official Microsoft Visual Studio Code extension for the Black Python code formatter. It provides formatting support for Python files directly within VS Code, including full-document, range, and multi-range formatting, as well as notebook cell formatting. The architecture follows a client-server LSP pattern: a TypeScript extension (client) communicates via stdio or named pipe with a Python LSP server that invokes Black. The server is built on pygls and lsprotocol, with a shared infrastructure library (`@vscode/common-python-lsp`) for common LSP utilities. The extension bundles Black as a dependency and supports flexible configuration (custom paths, interpreters, arguments). It includes comprehensive unit and integration tests for both TypeScript and Python components, with test fixtures covering edge cases like unformatted/formatted pairs, notebook scenarios, and internationalization. While the implementation is solid and follows established patterns for VS Code formatter extensions, it relies heavily on a shared submodule and has some minor version inconsistencies (e.g., outdated minimum version constant in the server code). The project is under active development (pre-release status) with automated CI/CD, dependency management via Dependabot, and AI-assisted workflows for issue triage and template synchronization.