liveBook · Manning

Ruff

As explained in Data Pipelines with Apache Airflow, Second Edition

Ruff is a fast Python linter and code formatter implemented in Rust.

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:

How Data Pipelines with Apache Airflow, Second Edition covers it

How deep it goes
Demonstrates installation, check-mode execution, configuration, and Airflow-specific rules without detailing rule configuration.
Examples
Uses ruff check dags/ and an AIR3 preview command for Airflow migration checks.
What you can do after
Operate/configure Ruff to check and format DAG code and identify Airflow 3 migration changes.
How it connects
Combines concerns associated with Flake8, Black, pyproject.toml, and Airflow DAG migration.

This explainer was generated by Manning's knowledge graph from the text of Data Pipelines with Apache Airflow, Second Edition. The section links point to the parts of the book it draws on.