Add link to relevant issue for unused variable preview behavior (#12841)

This commit is contained in:
Micha Reiser 2024-08-12 13:26:40 +02:00 committed by GitHub
parent aa0db338d9
commit 2ea79572ae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -261,6 +261,7 @@ pub(crate) fn unused_variable(checker: &Checker, scope: &Scope, diagnostics: &mu
if (binding.kind.is_assignment()
|| binding.kind.is_named_expr_assignment()
|| binding.kind.is_with_item_var())
// Stabilization depends on resolving https://github.com/astral-sh/ruff/issues/8884
&& (!binding.is_unpacked_assignment() || checker.settings.preview.is_enabled())
&& binding.is_unused()
&& !binding.is_nonlocal()