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.
autopep8 is a production-grade Python code formatter that automatically modifies source code to conform to the PEP 8 style guide. It operates as both a CLI tool and a library, using pycodestyle to detect violations and applying targeted fixes for most reported error codes (E1xx, E2xx, E3xx, E4xx, E5xx, E7xx, E9xx, and W6xx). The tool supports incremental formatting, aggressive mode, configuration file inheritance (pyproject.toml, setup.cfg, tox.ini, .pep8, .flake8), and integration with pre-commit hooks and editors like Vim. The entire logic is contained in a single monolithic module (autopep8.py), which includes a complex line-wrapping system for long lines, a reindentation engine, and token-based heuristics. The test suite is exceptionally thorough, with fixture-based regression tests and an 'acid test' framework that validates correctness on arbitrary Python files (including live PyPI packages). While the single-file architecture limits modularity, the internal components are well-factored and demonstrate strong engineering practice.