[ruff] Remove pytest-fixture-autouse (RUF076) - #26240
Conversation
Summary -- This PR reverts #25477 and closes #26178. It should also reopen #12491. The reason for the revert is that this rule is very opinionated. I knew that going in, but I failed to consider the effect of adding a pedantic rule to the `RUF` selector, which many preview users enable as a whole. The implementation was okay otherwise and can be reinstated once we have a better category for the rule, which #1774 should help with. The downside of a revert as compared to marking the rule as removed is that it will invalidate any configs that already `ignore`d the rule, but the rule has only been out for two weeks, so hopefully this is not too painful. It seems weird to un-remove a rule in the future, so reverting seems preferable overall. We should also be careful not to release a different rule under the same code, at least in the same release as this revert, otherwise such `ignore`s will silently ignore the wrong rule.
|
| code | total | + violation | - violation | + fix | - fix |
|---|---|---|---|---|---|
| pytest-fixture-autouse | 1952 | 0 | 1952 | 0 | 0 |
|
I guess this is ready for review. The ecosystem check is showing the |
|
im aware of a dozens of repos that have this on ignore already, so they would get direct churn |
|
Given that it has already been ignored so actively, I'm leaning towards marking it as removed. |
|
The churn wouldn't be as bad as I feared as long as #26113 also lands this week, but yeah let's go ahead and mark as removed, otherwise the ecosystem check will continue to fail. That also has the benefit of reserving/blocking the error code from being used by another rule. |
|
Makes sense. We can still remove the |
ruff] Ban pytest autouse fixtures (RUF076) (#25477)"ruff] Remove pytest-fixture-autouse (RUF076)
|
Switched this to a removal instead of reverting and updated the summary/title. |
Summary
This PR removes
RUF076that was added in #25477 and closes #26178. It should also reopen #12491.The reason for the removal is that this rule is very opinionated. I knew that going in, but I failed
to consider the effect of adding a pedantic rule to the
RUFselector, which many preview usersenable as a whole.
The implementation was okay otherwise and can be reinstated once we have a better category for the
rule, which #1774 should help with.
We initially opted for a full revert, but marking the rule as removed both avoids an invalid configuration error for projects that already
ignorethe rule (although they will still see a warning) and prevents another rule in the future from reusing the code.I don't believe we've done this before, but we can also reinstate the rule simply by switching its metadata back from
removed_sincetopreview_since(and updating the mdtests, which I also opted to preserve).