관리-도구
편집 파일: ast_walker.cpython-311.pyc
� �܋f� � � � d dl mZ d dlZd dlZd dlmZ d dlmZ d dlm Z m Z d dlmZ e rd dl mZ d dlmZ e ej gdf Z G d � d � � ZdS )� )�annotationsN)�defaultdict)�Sequence)� TYPE_CHECKING�Callable)�nodes)�BaseChecker)�PyLinterc �. � e Zd Zdd�Zdd �Zdd�Zdd�ZdS )� ASTWalker�linterr �return�Nonec � � d| _ t t � � | _ t t � � | _ || _ d| _ d S )Nr F)�nbstatementsr �list�visit_events�leave_eventsr � exception_msg)�selfr s �h/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/pylint/utils/ast_walker.py�__init__zASTWalker.__init__ s? � ����AL�T�AR�AR���AL�T�AR�AR������"����� �method�AstCallback�boolc �h � � t |d� � sdS t � fd�|j D � � � � S )N�checks_msgsTc 3 �L �K � | ]}�j � |� � V � �d S )N)r �is_message_enabled)�.0�mr s �r � <genexpr>z/ASTWalker._is_method_enabled.<locals>.<genexpr>( s3 �� � � �Q�Q��4�;�1�1�!�4�4�Q�Q�Q�Q�Q�Qr )�hasattr�anyr )r r s ` r �_is_method_enabledzASTWalker._is_method_enabled% s@ �� ��v�}�-�-� ��4��Q�Q�Q�Q�f�>P�Q�Q�Q�Q�Q�Qr �checkerr c � � t � � }t � � }| j }| j }t |� � D ]�}|dd� }|dk r�|� d� � rVt ||� � }| � |� � r0|| � |� � |� |� � �~|� d� � rUt ||� � } | � | � � r0|| � | � � |� |� � ��t |dd� � } | rGt j D ]<}|j � � � }||vr|| � | � � �;dS dS )z>Walk to the checker's dir and collect visit and leave methods.� N�default�visit_�leave_� visit_default) �setr r �dir� startswith�getattrr&