-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
False Positive 🦟A message is emitted but nothing is wrong with the codeA message is emitted but nothing is wrong with the codeMatch case
Milestone
Description
Bug description
archinstall uses conditional case statements to determine password strength:
Here is a simplified version of the code:
def password_strength(length):
match length:
case num if 13 <= num:
return 'strong'
case num if 11 <= num <= 12:
return 'moderate'
case num if 7 <= num <= 10:
return 'weak'
case num if num <= 6:
return 'very-weak'
The code works fine, but Pylint emits bare-name-capture-pattern
warnings when checking it.
Configuration
Command used
pylint match.py
Pylint output
match.py:3:13: E1901: The name capture `case num` makes the remaining patterns unreachable. Use a dotted name (for example an enum) to fix this. (bare-name-capture-pattern)
match.py:5:13: E1901: The name capture `case num` makes the remaining patterns unreachable. Use a dotted name (for example an enum) to fix this. (bare-name-capture-pattern)
match.py:7:13: E1901: The name capture `case num` makes the remaining patterns unreachable. Use a dotted name (for example an enum) to fix this. (bare-name-capture-pattern)
Expected behavior
No bare-name-capture-pattern
warnings
Pylint version
pylint: 4.0.0
astroid: 4.0.1
Python 3.13.7
OS / Environment
Arch Linux
Additional dependencies
mbyrnepr2, arcan1s and latk
Metadata
Metadata
Assignees
Labels
False Positive 🦟A message is emitted but nothing is wrong with the codeA message is emitted but nothing is wrong with the codeMatch case