Code Analysis in Python

17 projects in Developer Tools. Most starred: ruff, black and mypy.

Ruff is a linter and formatter written in Rust that reimplements rules from Flake8 and many of its plugins, isort, pyupgrade and others, and its formatter is designed to match Black's output. Many projects have replaced Flake8, isort and Black with Ruff alone. Pylint performs deeper analysis with more type inference and catches different problems, at the cost of speed and configuration. Bandit looks specifically for common security issues. pre-commit runs any of these tools automatically before each commit.

For type checking, mypy is the original reference checker. Pyright, from Microsoft, is fast and powers type checking in VS Code's Pylance extension. ty, from Astral (the makers of Ruff and uv), and Pyrefly, from Meta, are newer Rust-based checkers and language servers focused on speed. Rules and inference differ between checkers, so pick one per project and run it in CI.

Other listed tools cover narrower jobs: vulture finds dead code, import-linter enforces architectural layers between packages, complexipy measures cognitive complexity, ast-grep searches and rewrites code by syntax tree, and Rope is a refactoring library used by editors. These are most useful as targeted checks added to CI once the basics are in place: a team that already runs Ruff and a type checker can add import-linter to keep layers separate or vulture to find code that nothing calls anymore, without slowing down the everyday edit and commit loop.

Deeper lists: awesome-flake8-extensionsawesome-python-typing

General4

import-linter

A linter that enforces architectural constraints on imports between Python modules.

1.2kupdated 11d ago

vulture

A tool for finding and analyzing dead Python code.

4.9kupdated 12d ago2.16

complexipyRust core

Cognitive complexity analysis for Python code, written in Rust.

896updated today8.1.0

prospector

A tool to analyze Python code.

2.1kupdated 5d ago1.19.1

Git Hooks1

pre-commit

A framework for managing and maintaining multi-language pre-commit hooks.

15.7kupdated 4d ago4.7.0

Linters and Formatters6

ruffRust core

An extremely fast Python linter and code formatter.

50.3kupdated today0.17.2

black

The uncompromising Python code formatter.

42kupdated today26.10.1

isort

A Python utility / library to sort imports.

7kupdated 2d ago9.0.2

pylint

A fully customizable source code analyzer.

5.7kupdated today4.1.3

flake8

A wrapper around pycodestyle, pyflakes and McCabe.

3.8kupdated 11d ago

bandit

A tool designed to find common security issues in Python code.

8.3kupdated 4d ago1.9.4

Refactoring2

rope

Rope is a Python refactoring library.

2.2kupdated today1.15.0

ast-grep-cliRust core

A CLI tool for structural code search, linting, and rewriting based on syntax trees.

16.3kupdated today0.51.0

Type Checkers4

mypy

A static type checker for Python.

20.7kupdated 1d ago

ty

An extremely fast Python type checker and language server.

20kupdated 1d ago0.0.91

pyright

Full-featured static type checker for Python from Microsoft, the engine behind Pylance.

15.7kupdated 1d ago1.1.414

pyreflyRust core

A fast type checker and language server for Python.

7.1kupdated today1.4.0
Esc

Type to search every entry. ↑↓ to move, Enter to open.