This is an automated email from the ASF dual-hosted git repository.
weilee pushed a commit to branch v3-0-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v3-0-test by this push:
new 8a1b512f221 docs(ruff-AIR-rules-usage): remove --preview as it's
stabilized after ruff==0.13.0 (#55516) (#55530)
8a1b512f221 is described below
commit 8a1b512f221c46191bafdb43979d8320ec11e6c4
Author: Wei Lee <[email protected]>
AuthorDate: Mon Sep 15 07:41:15 2025 +0800
docs(ruff-AIR-rules-usage): remove --preview as it's stabilized after
ruff==0.13.0 (#55516) (#55530)
---
airflow-core/docs/best-practices.rst | 4 ++--
.../docs/installation/upgrading_to_airflow3.rst | 19 +++++++------------
2 files changed, 9 insertions(+), 14 deletions(-)
diff --git a/airflow-core/docs/best-practices.rst
b/airflow-core/docs/best-practices.rst
index 610aaf4615e..cad1f4c34a4 100644
--- a/airflow-core/docs/best-practices.rst
+++ b/airflow-core/docs/best-practices.rst
@@ -310,13 +310,13 @@ Installing and Using ruff
.. code-block:: bash
- pip install "ruff>=0.11.6"
+ pip install "ruff>=0.13.0"
2. **Running ruff**: Execute ``ruff`` to check your dags for potential issues:
.. code-block:: bash
- ruff check dags/ --select AIR3 --preview
+ ruff check dags/ --select AIR3
This command will analyze your dags located in the ``dags/`` directory and
report any issues related to the specified rules.
diff --git a/airflow-core/docs/installation/upgrading_to_airflow3.rst
b/airflow-core/docs/installation/upgrading_to_airflow3.rst
index 8b733ad27f0..6579ae86142 100644
--- a/airflow-core/docs/installation/upgrading_to_airflow3.rst
+++ b/airflow-core/docs/installation/upgrading_to_airflow3.rst
@@ -88,37 +88,32 @@ Step 3: Dag Authors - Check your Airflow Dags for
compatibility
To minimize friction for users upgrading from prior versions of Airflow, we
have created a dag upgrade check utility using `Ruff
<https://docs.astral.sh/ruff/>`_.
-The latest available ``ruff`` version will have the most up-to-date rules, but
be sure to use at least version ``0.11.6``. The below example demonstrates how
to check
-for dag incompatibilities that will need to be fixed before they will work as
expected on Airflow 3.
+The latest available ``ruff`` version will have the most up-to-date rules, but
be sure to use at least version ``0.13.0``. The below example demonstrates how
to check
+for Dag incompatibilities that will need to be fixed before they will work as
expected on Airflow 3.
.. code-block:: bash
- ruff check dag/ --select AIR301 --preview
+ ruff check dags/ --select AIR301
To preview the recommended fixes, run the following command:
.. code-block:: bash
- ruff check dag/ --select AIR301 --show-fixes --preview
+ ruff check dags/ --select AIR301 --show-fixes
Some changes can be automatically fixed. To do so, run the following command:
.. code-block:: bash
- ruff check dag/ --select AIR301 --fix --preview
+ ruff check dags/ --select AIR301 --fix
-Some of the fixes are marked as unsafe. Unsafe fixes usually do not break dag
code. They're marked as unsafe as they may change some runtime behavior. For
more information, see `Fix Safety
<https://docs.astral.sh/ruff/linter/#fix-safety>`_.
+Some of the fixes are marked as unsafe. Unsafe fixes usually do not break Dag
code. They're marked as unsafe as they may change some runtime behavior. For
more information, see `Fix Safety
<https://docs.astral.sh/ruff/linter/#fix-safety>`_.
To trigger these fixes, run the following command:
.. code-block:: bash
- ruff check dags/ --select AIR301 --fix --unsafe-fixes --preview
-
-.. note::
- Ruff has strict policy about when a rule becomes stable. Till it does you
must use --preview flag.
- The progress of Airflow Ruff rule become stable can be tracked in
https://github.com/astral-sh/ruff/issues/17749
- That said, from Airflow side the rules are perfectly fine to be used.
+ ruff check dags/ --select AIR301 --fix --unsafe-fixes
.. note::