Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Meta Engineering 6 min read Announcement mediumAdept

Fixit 2: Meta’s next-generation auto-fixing linter

Fixit 2 is a partial rewrite of Meta's open-source Python auto-fixing linter, built on LibCST so rules can safely suggest and apply code replacements without regex or broken syntax. Compared with Flake8, which only reports line/column, cannot suggest fixes and relies on the stdlib ast module, Fixit 2 adds local in-repo lint rules, hierarchical TOML configuration for monorepos, and an improved CLI and API. A rule takes under a dozen lines with inline VALID/INVALID test cases, and passing a replacement CST node to report() supplies an autofix. Applied broadly, `fixit fix` can also drive codemods across a large codebase while the rule stays in place to catch new occurrences.

Assumes: PythonLintersAbstract syntax trees

Related posts

  • Automating dead code cleanup

    Meta Engineering mediumAdept

    Meta's SCARF framework finds dead code by building a cross-language, symbol-level dependency graph from Glean and augmenting it with runtime usage data such as API endpoint logs, URI dispatch tables and async job invocations, then garbage-collects unreachable nodes, subgraphs and cycles. Switching from per-symbol classifiers to whole-graph analysis raised dead code removal in one large codebase by nearly 50%, at the cost of a longer indexing and data-pipeline cycle that makes prototyping harder. Over five years SCARF has deleted more than 100 million lines in over 370,000 change requests generated through CodemodService, with some languages auto-merged without review. BigGrep textual-reference checks act as a conservative fallback, accepting false negatives to avoid unsafe deletions.

  • Using Docker AI Tools for Devs to Provide Context for Better Code Fixes

    Docker mediumAdept

    LLMs fix lint violations far better when given the surrounding code, so Docker Labs built a prompt-driven pipeline where each step runs in a container: Pylint produces a violation report, violations are loaded into SQLite, and Tree-sitter parses the project into an AST whose top-level statement ranges are indexed alongside the source. The LLM then queries this database (writing its own SQL from the schema) to retrieve the enclosing function for a violation before proposing a fix. This sidesteps context-window limits of reading whole files, and the same pattern generalizes to any tool that maps code locations to issues.

  • Making Python in Zed Fun

    Zed easyNovice

    Zed reworked its Python support around a generic per-language toolchain selector backed by Microsoft's python-environment-tools, the same library Visual Studio Code uses for venv detection. A manifest tree tracks the nearest pyproject.toml so each monorepo sub-project gets its own toolchain. Zed also runs a separate language server per toolchain rather than making servers juggle multiple environments. Basedpyright is now the default LSP, ty and Ruff work out of the box, Pyrefly is available via an extension, and the team plans to move Astral's ty into core and add notebooks in 2026.

  • Automating product deprecation

    Meta Engineering mediumAdept

    SCARF (Systematic Code and Asset Removal Framework) is Meta's tooling for deprecating products by removing dead code and unused data, credited with deleting over 100M lines of code in five years and petabytes of data across 12.8M data types in 21 systems in one year. Engineers scope a deprecation by making only boundary decisions ("Flag Dependency" or "Add to Project"), and SCARF computes a daily-refreshed deletion roadmap that orders removals safely: mobile clients before GraphQL definitions, then business logic, schemas, and finally data. Static and dynamic usage signals block automated deletion of anything still in use. Engineers can triage or override those signals, for example deleting an endpoint that still gets trickle traffic, and generate targeted dependency-breaking code changes.

  • How to Fix ESLint Violations with AI Assistance

    Docker mediumAdept

    An LLM can produce correct fixes for ESLint violations once it has tools that supply minimal, precise context. ESLint's JSON output for even 100 violations exceeds 10,000 characters, so the full report is written to an ephemeral Docker volume and read through condensed or per-file parse tools rather than passed through the model's context. A Dockerized Tree-sitter tool then fetches the AST node and surrounding code for a given line. Violations are grouped by whether they need source context and human supervision. The agent fixed individual violations such as floating promises and unused vars, but it would not loop through multiple violations unless each prompt named a specific rule.

The quest for software engineering knowledge.

Look:
Layout: