Overview
TheLinter class provides a type-safe wrapper around Ruff, Astral’s extremely fast Python linter and formatter written in Rust. Ruff combines the functionality of multiple tools (Flake8, Black, isort, and more) into a single, high-performance package.
Location
pyrig.rig.tools.linter.Linter (rig/tools/linter.py:17)
Quick Start
Linting
Basic Check
Check with Auto-Fix
Formatting
Format Code
Common Workflows
Pre-commit Check
Auto-fix and Format
CI/CD Check
Advanced Usage
Select Specific Rules
Configuration Files
Ruff automatically reads configuration frompyproject.toml or ruff.toml:
Output Formats
Checking Exit Codes
Integration with Package Manager
Customization
Override methods to customize linter behavior:Tool Configuration
Complete Example
Ruff Rules Reference
Common rule categories:E- pycodestyle errorsF- PyflakesW- pycodestyle warningsI- isortN- pep8-namingD- pydocstyleB- flake8-bugbearA- flake8-builtinsC90- McCabe complexityS- flake8-bandit (security)T20- flake8-printRUF- Ruff-specific rules
See Also
Ruff Documentation
Official Ruff documentation
Type Checker
Ty type checker wrapper
Tools Overview
Learn about the Tool pattern
Project Tester
Run tests with pytest