bgvddlmZddlmZddlmZddlmZddlm Z erddl m Z GddeZ dd Z dS)) annotations) TYPE_CHECKING)nodes) BaseChecker)only_required_for_messages)PyLinterc`eZdZdZdZddiZeddd 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-elifaUsed 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.IfreturnNonect|jdtjo||jd}|r&|r&|d|jddSdSdS)Nr r)r) isinstancebodyrIf_has_no_else_clausehas_elif_block add_messageorelse)selfrbody_ends_with_ifs q/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/pylint/extensions/confusing_elif.pyvisit_ifz(ConfusingConsecutiveElifChecker.visit_if$s& IbM58  6&&ty}55      P%6 P   9 A  O O O O O P P P Pboolc|j}|rOt|dtjr/|dj}|r t|dtj/|r t|dtjrdSdS)NrTF)rrrr)rrs rrz3ConfusingConsecutiveElifChecker._has_no_else_clause,s~ &F1Iux88 &AY%F &F1Iux88 & F1Iux88 4urN)rrrr)rrrr ) __name__ __module__ __qualname____doc__namemsgsrr staticmethodrrrr r s D  D  <==PPP>=P\rr linterrrrcJ|t|dS)N)register_checkerr )r*s rregisterr-6s% ;FCCDDDDDrN)r*rrr) __future__rtypingrastroidrpylint.checkersrpylint.checkers.utilsr pylint.lintrr r-r)rrr4s #""""" ''''''<<<<<<%$$$$$$!!!!!k!!!HEEEEEEr