Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib64/python3.11/site-packages/prospector/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib64/python3.11/site-packages/prospector/__pycache__/suppression.cpython-311.pyc

�

�܋fs���dZddlZddlZddlmZddlmZddlmZddl	m
Z
ddlmZddl
mZejd	ej��Zejd
ej��Zejd��Zd�Zd
diZdeefd�Zdeefd�ZdS)aI
Each tool has its own method of ignoring errors and warnings.
For example, pylint requires a comment of the form

    # pylint disable=<error codes>

PEP8 will not warn on lines with

    # noqa

Additionally, flake8 follows that convention for pyflakes errors,
but pyflakes itself does not.

Finally, an entire file is ignored by flake8 if this line is found
in the file:

    # flake8\: noqa       (the \ is needed to stop prospector ignoring this file :))

This module's job is to attempt to collect all of these methods into
a single coherent list of error suppression locations.
�N)�defaultdict)�Path)�List)�encoding)�FatalProspectorException)�Messagezflake8[:=]\s*noqaz#\s+noqaz/^Suppressed \'([a-z0-9-]+)\' \(from line \d+\)$c���d}t��}t|��D]S\}}t�|��rd}t�|��r|�|dz���T||fS)z�
    Finds all pep8/flake8 suppression messages

    :param file_contents:
        A list of file lines
    :return:
        A pair - the first is whether to ignore the whole file, the
        second is a set of (0-indexed) line numbers to ignore.
    FT�)�set�	enumerate�_FLAKE8_IGNORE_FILE�search�_PEP8_IGNORE_LINE�add)�
file_contents�ignore_whole_file�ignore_lines�line_number�lines     �g/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/prospector/suppression.py�get_noqa_suppressionsr%s������5�5�L�&�}�5�5�.�.���T��%�%�d�+�+�	%� $���#�#�D�)�)�	.����[�1�_�-�-�-���l�*�*�z
unused-import))�pyflakes�FL0001)�frosted�E101�messagesc���t��}td���}|D]�}|jdkr�|jdkr�t�|j��}|std|j�����|�d��}||j	j
}||j	j�|����|jdkr|�
|j	j
����||fS)Nc�*�tt��S�N)r�list�rr�<lambda>z-_parse_pylint_informational.<locals>.<lambda>Ds���D�0A�0A�r�pylintzsuppressed-messagez)Could not parsed suppressed message from r
zfile-ignored)rr�source�code�_PYLINT_SUPPRESSED_MESSAGE�match�messager�group�location�pathr�appendr)r�ignore_files�ignore_messagesr)r(�suppressed_code�	line_dicts       r�_parse_pylint_informationalr2Bs����5�5�L�'�(A�(A�B�B�O��8�8���>�X�%�%��|�3�3�3�3�8�8���I�I���r�2�3p�_f�_n�3p�3p�q�q�q�"'�+�+�a�.�.��+�G�,<�,A�B�	��'�*�/�0�7�7��H�H�H�H����/�/�� � ��!1�!6�7�7�7����(�(r�	filepathsc�"�t��}tt��}td���}|D]�}	tj|���d��}nE#tj$r3}t
j|j�d|j	��t��Yd}~�hd}~wwxYwt|��\}}	|r|�|��||xx|	zcc<��t|��\}
}||
z}|���D]�\}}|���D]g\}
}|D]_}|||
�d|f��|tvr1t|D]#}|||
�|���$�`�h��|||fS)z�
    Given every message which was emitted by the tools, and the
    list of files to inspect, create a list of files to ignore,
    and a map of filepath -> line-number -> codes to ignore
    c�*�tt��Sr )rrr"rrr#z"get_suppressions.<locals>.<lambda>^s��;�s�3C�3C�r�
z: Nr$)rrr�read_py_file�split�CouldNotHandleEncoding�warnings�warnr,�	__cause__�
ImportWarningrrr2�items�_PYLINT_EQUIVALENTS)r3r�paths_to_ignore�lines_to_ignore�messages_to_ignore�filepathr�err�ignore_filer�pylint_ignore_files�pylint_ignore_messagesrr�codesr&�
equivalents                 r�get_suppressionsrJVs����e�e�O�'��,�,�O�*�+C�+C�D�D���2�2��	�$�1�(�;�;�A�A�$�G�G�M�M���.�	�	�	��M�S�X�8�8���8�8�-�H�H�H��H�H�H�H�����	����
%:�-�$H�$H�!��\��	*�����)�)�)���!�!�!�\�1�!�!�!�!�3N�h�2W�2W�/��/��*�*�O�0�6�6�8�8�R�R���$�"&�*�*�,�,�	R�	R��K���
R�
R��"�8�,�[�9�=�=�x��>N�O�O�O��.�.�.�&9�$�&?�R�R�
�*�8�4�[�A�E�E�j�Q�Q�Q�Q��	
R�	R��O�-?�?�?s�'A � B"�/)B�B")�__doc__�rer:�collectionsr�pathlibr�typingr�
prospectorr�prospector.exceptionsr�prospector.messager�compile�
IGNORECASEr
rr'rr?r2rJr"rr�<module>rUs?����*
�	�	�	�����#�#�#�#�#�#�������������������:�:�:�:�:�:�&�&�&�&�&�&� �b�j�!5�r�}�E�E���B�J�{�B�M�:�:��'�R�Z�(Z�[�[��+�+�+�,����)�$�w�-�)�)�)�)�(#@��T�
�#@�#@�#@�#@�#@�#@r

Hacked By AnonymousFox1.0, Coded By AnonymousFox