This is an automated email from the ASF dual-hosted git repository.
kaxilnaik pushed a commit to branch v3-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v3-1-test by this push:
new 381cec56309 docs(ruff-AIR-rules-usage): remove --preview as it's
stablized after ruff==0.13.0 (#55516)
381cec56309 is described below
commit 381cec56309df7c4a64f72700c6634dab0196f68
Author: Wei Lee <[email protected]>
AuthorDate: Fri Sep 12 00:55:34 2025 +0800
docs(ruff-AIR-rules-usage): remove --preview as it's stablized after
ruff==0.13.0 (#55516)
(cherry picked from commit 31234528b2813c784743204f002e2112964da612)
---
airflow-core/docs/best-practices.rst | 2 +-
airflow-core/docs/installation/upgrading_to_airflow3.rst | 15 +++++----------
2 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/airflow-core/docs/best-practices.rst
b/airflow-core/docs/best-practices.rst
index 7feb0089bec..8d8f290649b 100644
--- a/airflow-core/docs/best-practices.rst
+++ b/airflow-core/docs/best-practices.rst
@@ -316,7 +316,7 @@ Installing and Using ruff
.. 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 c0aa1b8e33f..115c3366535 100644
--- a/airflow-core/docs/installation/upgrading_to_airflow3.rst
+++ b/airflow-core/docs/installation/upgrading_to_airflow3.rst
@@ -89,24 +89,24 @@ 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/>`_ combined with `AIR
<https://docs.astral.sh/ruff/rules/#airflow-air>`_ rules.
The rules AIR301 and AIR302 indicate breaking changes in Airflow 3, while
AIR311 and AIR312 highlight changes that are not currently breaking but are
strongly recommended for updates.
-The latest available ``ruff`` version will have the most up-to-date rules, but
be sure to use at least version ``0.11.13``. The below example demonstrates how
to check
+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 dags/ --select AIR301 --preview
+ ruff check dags/ --select AIR301
To preview the recommended fixes, run the following command:
.. code-block:: bash
- ruff check dags/ --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 dags/ --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>`_.
@@ -114,12 +114,7 @@ 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::