duplicate-entry-in-dunder-all (RUF068)
Preview (since 0.14.14) · Related issues · View source
Fix is sometimes available.
This rule is unstable and in preview. The --preview flag is required for use.
What it does
Detects duplicate elements in __all__ definitions.
Why is this bad?
Duplicate elements in __all__ serve no purpose and can indicate copy-paste errors or
incomplete refactoring.
Example
Use instead:
Fix Safety
This rule's fix is marked as unsafe if the replacement would remove comments attached to the original expression, potentially losing important context or documentation.
For example: