Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib/python3.11/site-packages/pylint/checkers/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/pylint/checkers/__pycache__/spelling.cpython-311.pyc

�

�܋f�@���dZddlmZddlZddlZddlZddlmZddlmZm	Z	ddl
mZddlm
Z
ddlmZejd	krdd
lmZndd
lmZerddlmZ	ddlZddlmZmZmZmZmZmZd
ZnX#e$rPdZdZGd�d��ZGd�d��ZGd�d��ZGd�d��ZGd�d��Z			d?d@d �ZYnwxYwdAd"�ZdBd%�Z dCd)�Z!e��Z"Gd*�d+e��Z#Gd,�d-e��Z$Gd.�d/e��Z%Gd0�d1e%��Z&Gd2�d3e%��Z'Gd4�d5e��Z(ej)d6��Z*dDd8�Z+Gd9�d:e
��Z,dEd>�Z-dS)Fz7Checker for spelling errors in comments and docstrings.�)�annotationsN)�Pattern)�
TYPE_CHECKING�Any)�nodes)�BaseTokenChecker)�only_required_for_messages)��)�Literal)�PyLinter)�Chunker�EmailFilter�Filter�	URLFilter�WikiWordFilter�
get_tokenizerTFc��eZdZdS)rN��__name__�
__module__�__qualname__���i/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/pylint/checkers/spelling.pyrr,��������rrc��eZdZdS)rNrrrrrr/rrrc��eZdZdS)rNrrrrrr2rrrc��eZdZdd�ZdS)r�word�str�return�boolc��t��N)�NotImplementedError��selfr s  r�_skipzFilter._skip6s��%�%rN�r r!r"r#)rrrr)rrrrr5s(������	&�	&�	&�	&�	&�	&rrc��eZdZdS)rNrrrrrr9s�������rr�tag�
str | None�chunkers�list[Chunker] | None�filters�list[Filter] | Noner"c��t��Sr%)r)r,r.r0s   rrr<s
��
�x�x�r�&list[tuple[Any, enchant.ProviderDesc]]c�^�tr%tj�����ngSr%)�PYENCHANT_AVAILABLE�enchant�Broker�
list_dictsrrr�_get_enchant_dictsr9Ds&��,?�G�7�>���&�&�(�(�(�R�Gr�inner_enchant_dicts�	list[str]c�"�dgd�|D��zS)N�c��g|]
}|d��S)rr��.0�ds  r�
<listcomp>z-_get_enchant_dict_choices.<locals>.<listcomp>Ls��5�5�5�A�1�Q�4�5�5�5rr)r:s r�_get_enchant_dict_choicesrCIs!��
�4�5�5�!4�5�5�5�5�5r�pyenchant_availabler#r!c�x�|r%d�|D��}dd�|����}nd}|s|dz
}|dz
}d|�d�S)	Nc�@�g|]}|d�d|dj�d���S)rz (��))�namer?s  rrBz*_get_enchant_dict_help.<locals>.<listcomp>Ts3��L�L�L�1�!�A�$�.�.�!�A�$�)�.�.�.�L�L�LrzAvailable dictionaries: z, z0No available dictionaries : You need to install zboth the python package and z*the system dependency for enchant to work.zSpelling dictionary name. �.)�join)r:rD�dict_as_str�enchant_helps    r�_get_enchant_dict_helprNOsp���E�L�L�8K�L�L�L��J�$�)�)�K�2H�2H�J�J���I��"�	;��:�:�L��D�D��7��7�7�7�7rc��eZdZdZdd�ZdS)	�WordsWithDigitsFilterzSkips words with digits.r r!r"r#c�4�td�|D����S)Nc3�>K�|]}|���V��dSr%)�isdigit)r@�chars  r�	<genexpr>z.WordsWithDigitsFilter._skip.<locals>.<genexpr>es*����3�3�d�4�<�<�>�>�3�3�3�3�3�3r)�anyr's  rr)zWordsWithDigitsFilter._skipds���3�3�d�3�3�3�3�3�3rNr*�rrr�__doc__r)rrrrPrPas.������"�"�4�4�4�4�4�4rrPc��eZdZdZdd�ZdS)	�WordsWithUnderscoreszSSkips words with underscores.

    They are probably function parameter names.
    r r!r"r#c�
�d|vS)N�_rr's  rr)zWordsWithUnderscores._skipns���d�{�rNr*rWrrrrZrZhs2��������
�����rrZc�&�eZdZUdZded<d
d�Zd	S)�RegExFilterz�Parent class for filters using regular expressions.

    This filter skips any words the match the expression
    assigned to the class attribute ``_pattern``.
    zPattern[str]�_patternr r!r"r#c�P�t|j�|����Sr%)r#r_�matchr's  rr)zRegExFilter._skip{s ���D�M�'�'��-�-�.�.�.rNr*)rrrrX�__annotations__r)rrrr^r^rsB�������������/�/�/�/�/�/rr^c�2�eZdZdZejd��ZdS)�CamelCasedWordz�Filter skipping over camelCasedWords.
    This filter skips any words matching the following regular expression:

           ^([a-z]\w+[A-Z]+\w+)

    That is, any words that are camelCasedWords.
    z^([a-z]+(\d|[A-Z])(?:\w+)?)N�rrrrX�re�compiler_rrrrdrds,���������r�z�8�9�9�H�H�Hrrdc�2�eZdZdZejd��ZdS)�SphinxDirectivesz�Filter skipping over Sphinx Directives.
    This filter skips any words matching the following regular expression:

           ^(:([a-z]+)){1,2}:`([^`]+)(`)?

    That is, for example, :class:`BaseQuery`
    z^(:([a-z]+)){1,2}:`([^`]+)(`)?Nrerrrriri�s,���������r�z�;�<�<�H�H�Hrric�.�eZdZUdZded<d
d�Zdd�Zd	S)�ForwardSlashChunkerz[This chunker allows splitting words like 'before/after' into 'before' and
    'after'.
    r!�_textr"�tuple[str, int]c�p�	|jst���d|jvr|j}d|_d|_|dfS|j�dd��\}}||_d|_|r6|r4|d���r|d���sd|_d|_|�d|��dfS|dfS)NT�/rr=rG���)rl�
StopIteration�_offset�split�isalpha)r(�text�pre_text�	post_texts    r�nextzForwardSlashChunker.next�s���	��:�
&�#�o�o�%��$�*�$�$��z�� �����
��Q�w��"&�*�"2�"2�3��":�":��H�i�"�D�J��D�L��
4� �
4� ��|�+�+�-�-�
4�!��|�+�+�-�-�	
4� ��
� ���"�0�0�Y�0�0�!�3�3��Q�;�r�tuple[str, Literal[0]]c�*�	d|jvr	|jdfS|j�dd��\}}|r|snP|d���r|d���st���|dz|z|_��t���)NTrorrGrp� )rlrsrtrq)r(rvrws   r�_nextzForwardSlashChunker._next�s���	4��$�*�$�$��z�1�}�$�"&�*�"2�"2�3��":�":��H�i��
�9�
���B�<�'�'�)�)�
&��1��1E�1E�1G�1G�
&�#�o�o�%�!�C��)�3�D�J�	4��o�o�rN)r"rm)r"ry)rrrrXrbrxr|rrrrkrk�sS����������J�J�J�����.
�
�
�
�
�
rrkz!(\s|^)(`{1,2})([^`]+)(\2)([^`]|$)�linec�@�dd�}t�||��S)z�Alter line so code flanked in back-ticks is ignored.

    Pyenchant automatically strips back-ticks when parsing tokens,
    so this cannot be done at the individual filter level.
    �	match_obj�
re.Match[str]r"r!c�X�|�d��|�d��zS)NrG�)�group)rs r�-replace_code_but_leave_surrounding_characterszW_strip_code_flanked_in_backticks.<locals>.replace_code_but_leave_surrounding_characters�s%�����q�!�!�I�O�O�A�$6�$6�6�6r)rr�r"r!)�CODE_FLANKED_IN_BACKTICK_REGEX�sub)r}r�s  r� _strip_code_flanked_in_backticksr��s5��7�7�7�7�*�-�-�5�t���rc�P�eZdZdZdZdddd�Zddd	d
ee��eee	��d�fddd
ddd�fdddddd�fdddddd�fdddddd�fdd d
dd!d�ffZ
d8d$�Zd9d)�Zd:d,�Z
ed-��d;d0���Zed-��d<d2���Zed-��d=d4���ZeZd>d6�Zd7S)?�SpellingCheckerz*Check spelling in comments and docstrings.�spelling)zEWrong spelling of a word '%s' in a comment:
%s
%s
Did you mean: '%s'?�wrong-spelling-in-commentz5Used when a word in comment is not spelled correctly.)zGWrong spelling of a word '%s' in a docstring:
%s
%s
Did you mean: '%s'?�wrong-spelling-in-docstringz7Used when a word in docstring is not spelled correctly.)z$Invalid characters %r in a docstring�invalid-characters-in-docstringz;Used when a word in docstring cannot be checked by enchant.)�C0401�C0402�C0403z
spelling-dictr=�choicez<dict name>)�default�type�metavar�choices�helpzspelling-ignore-words�stringz<comma separated words>z9List of comma separated words that should not be checked.)r�r�r�r�zspelling-private-dict-file�pathz<path to file>zIA path to a file that contains the private dictionary; one word per line.zspelling-store-unknown-words�n�ynz<y or n>z�Tells whether to store unknown words to the private dictionary (see the --spelling-private-dict-file option) instead of raising a message.zmax-spelling-suggestions��int�Nz:Limits count of emitted suggestions for spelling mistakes.z"spelling-ignore-comment-directivesz2fmt: on,fmt: off,noqa:,noqa,nosec,isort:skip,mypy:z�List of comma separated words that should be considered directives if they appear at the beginning of a comment and should not be checked.r"�Nonec���d|_tsdS|jjj}|sdSd�|jjj�d��D��|_|j�ddg��d�|jjj	�d��D��|_
|jjjr*tj
||jjj��|_ntj|��|_|jjjrt!��|_t%|t&gt(t*t,t.t0t2t4g���|_d|_dS)	NFc�6�g|]}|�����Sr��strip�r@�ws  rrBz(SpellingChecker.open.<locals>.<listcomp>2s-��
�
�
��A�G�G�I�I�
�
�
r�,�param�pylintc�6�g|]}|�����Srr�r�s  rrBz(SpellingChecker.open.<locals>.<listcomp>9s0��.
�.
�.
��
�G�G�I�I�.
�.
�.
r)r.r0T)�initializedr5�linter�config�
spelling_dict�spelling_ignore_wordsrs�ignore_list�extend�"spelling_ignore_comment_directives�ignore_comment_directive_list�spelling_private_dict_filer6�DictWithPWL�Dict�spelling_store_unknown_words�set�
unknown_wordsrrkrrrrPrZrdri�	tokenizer)r(�	dict_names  r�openzSpellingChecker.open*sn�� ���"�	��F��K�&�4�	��	��F�
�
�#�{�1�G�M�M�c�R�R�
�
�
���
	
�����(� 3�4�4�4�.
�.
��[�'�J�P�P�QT�U�U�.
�.
�.
��*�
�;��8�	9�!(�!4��4�;�-�H�"�"�D���")��i�!8�!8�D���;��:�	1�+.�5�5�D��&��)�*����%�$�� ��
�
�
��� ����r�msgidr!r}�line_numc�~�|}	tjd|��jdd}n#ttf$rd}YnwxYw|����d��rad|vr]|���dd�}|jD]6}|�d|z��r|t|��dzd�}n�7d}nd}t|��}|�
|�����D�]7\}}	|	|z
}	|���}
||jvs	|
|jvr�2|�d	��r't|��d
kr|d
d�}|
d
d�}
	|j
�|
��r��|j
�|��r��n3#tjj$r|�d||f���Y��wxYw|jjjrv|
|jvrkt/|jjjd
d���5}|�|
�d���ddd��n#1swxYwY|j�|
����`|j
�|��}||jjjd�=||	d�}
tjd|�d�|
��}|r|jd
d}n|
�|��}||	z
}|r|dz
}d|zdt|��zz}d�|��}|||d|�d�f}|�|||�����9dS)Nz^\s+rrG�#�	docstringr{TF)zu'zu"zr'zr"�r�)r}�args�azutf-8)�encoding�
z(\W|^)(z)(\W|$)�^z' or '�')rf�search�regs�
IndexError�AttributeErrorr��
startswithr��lenr�r��casefoldr�r��checkr6�errors�Error�add_messager�r�r�r�r�r��write�add�suggest�max_spelling_suggestions�indexrK)r(r�r}r��
original_line�
initial_space�iter_directive�starts_with_commentr �
word_start_at�lower_cased_word�f�suggestions�line_segmentra�col�	indicator�all_suggestionr�s                   r�_check_spellingzSpellingChecker._check_spellingXs���
�	��I�g�t�4�4�9�!�<�Q�?�M�M���N�+�	�	�	��M�M�M�	�����:�:�<�<�"�"�3�'�'�	(�K�u�,D�,D��:�:�<�<����#�D�#'�"D�
�
���?�?�3��#7�8�8����^�!4�!4�q�!8� ;� ;�<�D��E��#'���"'��/��5�5��#'�>�>�$�*�*�,�,�#?�#?�9	B�9	B��D�-��]�*�M�#�}�}�����t�'�'�'�+;�t�?O�+O�+O�����7�8�8�
8�S��Y�Y��]�]��A�B�B�x��#3�A�B�B�#7� �
��%�+�+�,<�=�=���
�%�+�+�D�1�1������>�'�
�
�
�� � �5�H�D�7�!������	
�����{�!�>�
B�#�4�+=�=�=����*�E��!(����9�����#3� 7� 7� 7�8�8�8�9�9�9�9�9�9�9�9�9�9�9����9�9�9�9��&�*�*�+;�<�<�<��#�0�8�8��>�>����� 2� K� M� M�N�#�M�N�N�3���	�":�T�":�":�":�L�I�I���3��*�Q�-��*�C�C�&�,�,�T�2�2�C��}�$��&���1�H�C� �3�Y�3��T���?�;�	�!)���{�!;�!;���m�Y�8M�N�8M�8M�8M�N��� � ��X�D� �A�A�A�A�s9	B�9	Bs9�&+�A�A�3F*�F*�*-G�G�H=�=I	�I	�tokens�list[tokenize.TokenInfo]c��|jsdS|D]z\}}\}}}}|tjkr_|dkr|�d��r�7|�d��r�M|�d��r�c|�d||���{dS)NrGz#!/z	# pylint:z# type: r�)r��tokenize�COMMENTr�r�)r(r��tok_type�token�	start_rowr\s      r�process_tokenszSpellingChecker.process_tokens�s�����	��F�6<�	T�	T�1�H�e�^�i��Q���8�+�+�+���>�>�e�&6�&6�u�&=�&=�>���#�#�K�0�0����#�#�J�/�/����$�$�%@�%��S�S�S��	T�	Trr��node�nodes.Modulec�0�|�|��dSr%��_check_docstring�r(r�s  r�visit_modulezSpellingChecker.visit_module�������d�#�#�#�#�#r�nodes.ClassDefc�0�|�|��dSr%r�r�s  r�visit_classdefzSpellingChecker.visit_classdef�r�r�*nodes.FunctionDef | nodes.AsyncFunctionDefc�0�|�|��dSr%r�r�s  r�visit_functiondefz!SpellingChecker.visit_functiondef�s��	
���d�#�#�#�#�#r�Jnodes.FunctionDef | nodes.AsyncFunctionDef | nodes.ClassDef | nodes.Modulec���|jsdS|jsdS|jdz}t|jj�����D]\}}|�d|||z��� dS)z*Check if the node has any spelling errors.NrGr�)r��doc_node�lineno�	enumerate�value�
splitlinesr�)r(r��
start_line�idxr}s     rr�z SpellingChecker._check_docstring�s�����	��F��}�	��F��[�1�_�
�"�4�=�#6�#A�#A�#C�#C�D�D�	X�	X�I�C��� � �!>��j�SV�FV�W�W�W�W�	X�	XrN)r"r�)r�r!r}r!r�r�r"r�)r�r�r"r�)r�r�r"r�)r�r�r"r�)r�r�r"r�)r�r�r"r�)rrrrXrI�msgsrC�
enchant_dictsrNr5�optionsr�r�r�r	r�r�r��visit_asyncfunctiondefr�rrrr�r��s������4�4��D�
�
�
���D�*
�� �(�4�4�]�C�C�.�.�}�>Q�R�R�
�
�		
�
$�� �4�S�	
�
�	
�
)���+�1�	
�
�		
�
+���%�%�	
�
�	
�
'����T�	
�
�	
�
1�O� �4�-�	
�
�
	
�g>�G�@+ �+ �+ �+ �\OB�OB�OB�OB�bT�T�T�T�& �� =�>�>�$�$�$�?�>�$� �� =�>�>�$�$�$�?�>�$� �� =�>�>�$�$�$�?�>�$�
/��X�X�X�X�X�Xrr�r�r
r�c�J�|�t|����dSr%)�register_checkerr�)r�s r�registerr
�s$��
���O�F�3�3�4�4�4�4�4r)NNN)r,r-r.r/r0r1r"r)r"r3)r:r3r"r;)r:r3rDr#r"r!)r}r!r"r!)r�r
r"r�).rX�
__future__rrf�sysr�r�typingrr�astroidr�pylint.checkersr�pylint.checkers.utilsr	�version_infor�typing_extensions�pylint.lintr
r6�enchant.tokenizerrrrrrr5�ImportErrorr9rCrNrrPrZr^rdrirkrgr�r�r�r
rrr�<module>rs>��
>�=�"�"�"�"�"�"�	�	�	�	�
�
�
�
�����������%�%�%�%�%�%�%�%�������,�,�,�,�,�,�<�<�<�<�<�<���v����������)�)�)�)�)�)��%�$�$�$�$�$�$�%��N�N�N��������������������������G���������������������������&�&�&�&�&�&�&�&�
�
�
�
�
�
�
�
��)-�'+��������)����8H�H�H�H�
6�6�6�6�8�8�8�8�#�"�$�$�
�4�4�4�4�4�F�4�4�4������6����
/�
/�
/�
/�
/�&�
/�
/�
/�:�:�:�:�:�[�:�:�:�	=�	=�	=�	=�	=�{�	=�	=�	=�(�(�(�(�(�'�(�(�(�V",���,P�!Q�!Q������HX�HX�HX�HX�HX�&�HX�HX�HX�V5�5�5�5�5�5s�A-�-AC�C

Hacked By AnonymousFox1.0, Coded By AnonymousFox