Ruff is a fast Python tool that combines linting and code formatting in one Rust-based package. It reduces setup compared with separate Flake8 and Black installations, while retaining broadly similar configuration through pyproject.toml. section 12.1.1
Check an Airflow DAG directory
Install Ruff and check DAG files without automatically changing them: python -m pip install ruff; python -m ruff check dags/. Airflow-specific checks can be enabled with ruff check dags/ --select AIR3 --preview --show-fixes, which flags changes needed when migrating from Airflow 2 to Airflow 3. section 12.1.1
Ruff supports practical Airflow code-quality work by:
- Checking code for style and lint violations. section 12.1.1
- Formatting code alongside linting. section 12.1.1
- Highlighting Airflow task-variable names that do not match task_id values. section 12.1.1
