Fast Python Linter Formatter
docs.astral.sh
2
Leaving SiteNav
External Link Disclaimer
You are about to visit docs.astral.sh. This website is not operated by us. We are not responsible for its content or privacy practices.
About this website
An extremely fast Python linter and code formatter written in Rust, achieving speeds 10 to 100 times faster than existing tools like Flake8, isort, and Black. With over 48,000 GitHub stars, it replaces multiple Python tooling components in a single binary, implementing over 900 lint rules sourced from Flake8 plugins including pyflakes, pycodestyle, pydocstyle, bandit, pylint, and isort. The linter covers categories including correctness bugs, style violations, security issues, complexity metrics, unused imports, naming conventions, docstring formatting, and modern Python feature adoption. The formatter is a Black-compatible code reformatter that produces identical output for the vast majority of files while running in milliseconds instead of seconds. Configuration is centralized in a single pyproject.toml or ruff.toml file, eliminating the need for separate configuration files per tool. Rule selection supports enabling or disabling individual rules, rule groups by prefix, or entire rule categories, with per-file overrides for specific directories or file patterns. The tool integrates with all major editors including VS Code, Neovim, PyCharm, and Sublime Text through Language Server Protocol, providing real-time diagnostics and format-on-save. Fix capabilities include automatic fixes for over 500 rules, unsafe fix detection with explicit warnings, and apply-all modes for batch correction. The tool is cache-aware, only re-linting files that have changed since the last run, and can be used in pre-commit hooks with minimal CI pipeline overhead. Import sorting, dead code elimination, and docstring convention enforcement are all handled in a single invocation.
Statistics
2
Views
0
Clicks
0
Like
0
Dislike