Bump ruff to 0.16.0 and pin the base lint rule set - #70725
Merged
Conversation
Lee-W
force-pushed
the
ruff-0-16-upgrade
branch
3 times, most recently
from
August 5, 2026 06:40
3f90948 to
2943978
Compare
Lee-W
marked this pull request as ready for review
August 5, 2026 08:28
Lee-W
requested review from
amoghrajesh,
ashb,
bugraoz93,
gopidesupavan,
jason810496,
jscheffl,
kaxil and
potiuk
as code owners
August 5, 2026 08:28
Lee-W
force-pushed
the
ruff-0-16-upgrade
branch
2 times, most recently
from
August 5, 2026 12:27
a7c9359 to
81258ea
Compare
Ruff 0.16 widened its default rule set from ~250 to ~510 enabled rules. Airflow's config uses extend-select, which layers on top of whatever Ruff currently enables by default, so the bump would have silently pulled in 261 unreviewed rules and produced sweeping autofix churn across the repo. Pin `select` to the rule groups Airflow has always effectively had enabled, so future Ruff releases cannot change our lint surface out from under us; everything intentionally on is still listed in extend-select as before. Two rules remain newly in scope under the pin, because they sit inside sections Airflow selects wholesale. Both are deferred behind `ignore` rather than fixed here: a version bump should not also carry semantic changes, and both need per-site judgement that deserves its own reviewed change. ISC004's autofix is unsafe, and LOG004's call sites can only be classified by tracing whether an exception is genuinely in flight at each one. Ruff 0.16 also started formatting Python blocks inside Markdown, which is why a task-sdk doc changes alongside the bump rather than in its own commit: its example was a bare statement that the formatter rewrites into a one-element tuple, which would have changed what the example teaches. Showing the entry in its surrounding context keeps it both correct and stable to format. The lockfile additionally picks up datamodel-code-generator 0.71.0. That is not part of this change: apache#70670 raised the declared floor to >=0.71.0 without regenerating uv.lock, leaving the lock pinned at a version its own constraint excludes, so any `uv lock` has to correct it.
Lee-W
force-pushed
the
ruff-0-16-upgrade
branch
from
August 6, 2026 06:59
81258ea to
29e7df4
Compare
Contributor
Backport failed to create: v3-3-test. View the failure log Run detailsNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
You can attempt to backport this manually by running: cherry_picker 858df99 v3-3-testThis should apply the commit to the v3-3-test branch and leave the commit in conflict state marking After you have resolved the conflicts, you can continue the backport process by running: cherry_picker --continueIf you don't have cherry-picker installed, see the installation guide. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Ruff 0.16 widened its default rule set from ~250 to ~510 enabled rules. Airflow's config uses
extend-select, which layers on top of whatever Ruff currently enables by default, so bumping the pin would have silently pulled in 261 unreviewed rules and produced sweeping autofix churn across the repo.What
selectinpyproject.tomlto the rule groups Airflow has always effectively had enabled (E4,E7,E9,F), so future Ruff releases cannot change the lint surface out from under us. Everything intentionally on is still listed inextend-select, unchanged.0.16.0:.pre-commit-config.yaml,devel-common/pyproject.toml, and the two prek script headers (scripts/ci/prek/check_imports_in_providers.py,scripts/ci/prek/ruff_format.py).ignorerather than fixed here — a version bump should not also carry semantic changes, and each needs per-site judgement that deserves its own reviewed change:ISC004(implicit string concat in a collection literal) — 109 sites, unsafe autofix.LOG004(.exception()outside an exception handler) — 13 sites; each call site can only be classified by tracing whether an exception isgenuinely in flight there.task-sdk/src/airflow/sdk/execution_time/schema/AGENTS.md: correct the bundle-registration snippet to match the actualget_bundle()/VersionBundleshape instead of a bareversions/__init__.pylist.Was generative AI tooling used to co-author this PR?
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.