관리-도구
편집 파일: magic_value.cpython-311.pyc
� �܋f� � � � d Z ddlmZ ddlmZ ddlmZ ddlm Z ddl mZmZ ddl mZ erddlmZ G d � d e� � Zdd�ZdS )z,Checks for magic values instead of literals.� )�annotations)�match)� TYPE_CHECKING)�nodes)�BaseChecker�utils)�HIGH)�PyLinterc � � � e Zd ZdZdZddiZddddd d �ffZd� fd�Zdd�Zd d�Z d!d�Z d"d�Zed#d�� � Z ej d� � d!d�� � Z� xZS )$�MagicValueCheckerz$Checks for constants in comparisons.zmagic-value�R2004)z;Consider using a named constant or an enum instead of '%s'.�magic-value-comparisonz�Using named constants instead of magic values helps improve readability and maintainability of your code, try to avoid them in comparisons.zvalid-magic-values)r ���� � �__main__�csvz<argument names>z�List of valid magic values that `magic-value-compare` will not detect. Supports integers, floats, negative numbers, for empty string enter ``''``, for backslash values just use one backslash e.g \n.)�default�type�metavar�help�linterr �return�Nonec �Z �� t � � � |�� � d| _ dS )zInitialize checker instance.�r � N)�super�__init__�valid_magic_vals)�selfr � __class__s ��n/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/pylint/extensions/magic_value.pyr zMagicValueChecker.__init__0 s, �� � �������'�'�'�9;����� c � � � � � � � r1t � fd�� j j j D � � � � � _ d S � j j j � _ d S )Nc 3 �B �K � | ]}�� |� � V � �d S �N)�_parse_rcfile_magic_numbers)�.0�valuer! s �r# � <genexpr>z)MagicValueChecker.open.<locals>.<genexpr>8 sE �� � � � *� *�� �0�0��7�7�*� *� *� *� *� *r$ )�_magic_vals_ext_configured�tupler �config�valid_magic_valuesr �r! s `r# �openzMagicValueChecker.open5 sv �� ��*�*�,�,� J�$)� *� *� *� *�!�[�/�B�*� *� *� %� %�D�!�!�!� %)�K�$6�$I�D�!�!�!r$ �boolc �L � t | j j j t � � S r'