G^| z d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl m
Z
erddlmZ G d d e Z
ddZdS )z!Ellipsis checker for Python code. )annotations)
TYPE_CHECKING)nodes)BaseChecker)only_required_for_messages)PyLinterc D e Zd ZdZddiZ ed dd Zd
S )EllipsisCheckerunnecessary_ellipsisW2301)zUnnecessary ellipsis constantunnecessary-ellipsiszUsed when the ellipsis constant is encountered and can be avoided. A line of code consisting of an ellipsis is unnecessary if there is a docstring on the preceding line or if there is a statement in the same scope.r
nodenodes.ConstreturnNonec t | dk rt |j t j r~t |j j t j t j f r|j j j s"t |j j j dk r|
d| dS dS dS dS )a_ Check if the ellipsis constant is used unnecessarily.
Emits a warning when:
- A line consisting of an ellipsis is preceded by a docstring.
- A statement exists in the same scope as the ellipsis.
For example: A function consisting of an ellipsis followed by a
return statement on the next line.
zbuiltins.Ellipsis r
)r N)pytype
isinstanceparentr ExprClassDefFunctionDefdoc_nodelenbodyadd_message)selfr s r/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/pylint/checkers/ellipsis_checker.pyvisit_constzEllipsisChecker.visit_const! s
KKMM0004;
33
1 t{1ENEDU3VWW
1
*3
1 t{).//!33
3$?????
1000 43 N)r r r r )__name__
__module____qualname__namemsgsr r r! r r
r
s[ !D
D 677@ @ @ 87@ @ @r! r
linterr r r c J | t | d S )N)register_checkerr
)r( s r registerr+ 9 s$
OF3344444r! N)r( r r r )__doc__
__future__r typingr astroidr pylint.checkersr pylint.checkers.utilsr pylint.lintr r
r+ r' r! r