ruff/crates/ruff_linter
Denys Kyslytsyn ed14dbb1a2
[flake8-pie] Avoid false positive for multiple assignment with auto() (PIE796) (#17274)
This fix closes #16868 

I noticed the issue is assigned, but the assignee appears to be actively
working on another pull request. I hope that’s okay!

<!--
Thank you for contributing to Ruff! To help us out with reviewing,
please consider the following:

- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title?
- Does this pull request include references to any relevant issues?
-->

## Summary

<!-- What's the purpose of the change? What does it do, and why? -->

As of Python 3.11.1, `enum.auto()` can be used in multiple assignments.
This pattern should not trigger non-unique-enums check.
Reference: [Python docs on
enum.auto()](https://docs.python.org/3/library/enum.html#enum.auto)

This fix updates the check logic to skip enum variant statements where
the right-hand side is a tuple containing a call to `enum.auto()`.

## Test Plan

<!-- How was it tested? -->

The added test case uses the example from the original issue. It
previously triggered a false positive, but now passes successfully.
2025-04-08 15:53:27 -04:00
..
resources [flake8-pie] Avoid false positive for multiple assignment with auto() (PIE796) (#17274) 2025-04-08 15:53:27 -04:00
src [flake8-pie] Avoid false positive for multiple assignment with auto() (PIE796) (#17274) 2025-04-08 15:53:27 -04:00
Cargo.toml Bump 0.11.4 (#17212) 2025-04-04 14:09:10 -04:00