You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a follow up to #58488 (comment), where enabling SIM017 was initially proposed.
This PR, however, enables B012, which is a more general rule that, in addition to return, also catches break and continue in finally blocks -- an exhaustive list of what PEP 765 prohibits.
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.
I'd fix B012 errors in separate PRs, then merge this one in. Just so that all the changes in different areas are reviewed by proper owners. To track, I'll file 3 to-do issues from this tomorrow.
So in total I see (only) 3 errors, would have expected more. 1 of them is fixed with the PR from @AutomationDev85, the second is in a similar area. And the one in Fab should also be easily fixable in my view.
As there is no harm in B012 and actually I agree it is a bad practice I have nothing against it and would rather favor it to enable it as well. But it is valid, there might be other opinions. Therefore we have pull requests! If we wait that the other PR is opened and the other two are fixed (either in this PR or in separate in parallel, then rebase this one...) then we just leave it open for a few days for others to object.
It is not in a complexity that it would require a VOTE on devlist in my view.
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
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.
https://docs.astral.sh/ruff/rules/jump-statement-in-finally/
This is a follow up to #58488 (comment), where enabling SIM017 was initially proposed.
This PR, however, enables B012, which is a more general rule that, in addition to
return, also catchesbreakandcontinueinfinallyblocks -- an exhaustive list of what PEP 765 prohibits.CC @jscheffl
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.