ruff/crates/ruff_linter/resources/test/fixtures/flake8_pie
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
..
PIE790.py [flake8-pie] Mark fix as unsafe if the following statement is a string literal (PIE790) (#14393) 2024-11-18 02:30:06 +00:00
PIE794.py Omit unrolled augmented assignments in PIE794 (#8634) 2023-11-12 20:40:33 +00:00
PIE796.py [flake8-pie] Avoid false positive for multiple assignment with auto() (PIE796) (#17274) 2025-04-08 15:53:27 -04:00
PIE796.pyi [flake8-pie] Allow cast(SomeType, ...) (PIE796) (#15141) 2024-12-30 15:52:35 +01:00
PIE800.py [flake8-pie] Remove following comma correctly when the unpacked dictionary is empty (PIE800) (#16008) 2025-02-07 08:52:10 +01:00
PIE804.py [flake8-pie] Preserve parentheses in unnecessary-dict-kwargs (#11372) 2024-05-11 18:04:54 -04:00
PIE807.py Generalize PIE807 to handle dict literals (#8608) 2023-11-13 17:55:17 +00:00
PIE808.py Improve handling of builtin symbols in linter rules (#10919) 2024-04-16 11:37:31 +01:00
PIE810.py Preserve raw string prefix and escapes (#15694) 2025-01-23 12:12:10 -05:00