8Iu v d dl mZ d dlmZ d dlmZ d dlmZ d dlm Z erd dl
mZ G d de Zdd
Z
dS ) )annotations)
TYPE_CHECKING)nodes)BaseChecker)only_required_for_messages)PyLinterc ` e Zd ZdZdZddiZ ed dd
Zedd Z d
S )ConfusingConsecutiveElifCheckerziChecks if "elif" is used right after an indented block that finishes with "if" or
"elif" itself.
confusing_elifR5601)zjConsecutive elif with differing indentation level, consider creating a function to separate the inner elifconfusing-consecutive-elifa Used when an elif statement follows right after an indented block which itself ends with if or elif. It may not be ovious if the elif statement was willingly or mistakenly unindented. Extracting the indented if statement into a separate function might avoid confusion and prevent errors.r
nodenodes.IfreturnNonec t |j d t j o| |j d }| r&|r&| d|j d d S d S d S )Nr
r )r )
isinstancebodyr If_has_no_else_clausehas_elif_blockadd_messageorelse)selfr body_ends_with_ifs r/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/pylint/extensions/confusing_elif.pyvisit_ifz(ConfusingConsecutiveElifChecker.visit_if$ s &IbM58
6&&ty}55 P%6 P9AOOOOO P P P P boolc | j }|rOt |d t j r/|d j }|r t |d t j /|r t |d t j rdS dS )Nr TF)r r r r )r r s r r z3ConfusingConsecutiveElifChecker._has_no_else_clause, s~ &F1Iux88 &AY%F &F1Iux88 & F1Iux88 4ur N)r r r r )r r r r )
__name__
__module____qualname____doc__namemsgsr r staticmethodr r r r
r
s D
D <==P P P >=P \ r r
linterr r r c J | t | d S )N)register_checkerr
)r* s r registerr- 6 s%
;FCCDDDDDr N)r* r r r )
__future__r typingr astroidr pylint.checkersr pylint.checkers.utilsr pylint.lintr r
r- r) r r