Your IP : 216.73.216.196


Current Path : /opt/alt/python37/lib/python3.7/site-packages/pydocstyle/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib/python3.7/site-packages/pydocstyle/__pycache__/violations.cpython-37.pyc

B

;��Y�)�@s(dZddlmZddlmZddlmZddlmZdZ	edd	d
dg�Z
Gdd
�d
e�ZGdd�de�Z
e
�dd�Ze�dd�Ze�dd�Ze�dd�Ze�dd�Ze�dd�Ze�dd�Ze�dd�Ze�d d!�Ze
�d"d#�Ze�d$d%d&�Ze�d'd(d&�Ze�d)d*d&�Ze�d+d,d&�Ze�d-d.d&�Ze�d/d0d&�Ze�d1d2�Z e�d3d4�Z!e�d5d6�Z"e�d7d8�Z#e�d9d:�Z$e�d;d<d&�Z%e�d=d>�Z&e�d?d@�Z'e�dAdBdC�Z(e�dDdEdF�Z)e
�dGdH�Z*e*�dIdJdK�Z+e*�dLdM�Z,e*�dNdO�Z-e
�dPdQ�Z.e.�dRdSdT�Z/e.�dUdVdW�Z0e.�dUdXdY�Z1e.�dZd[�Z2e.�d\d]d^�Z3e.�d_d`�Z4e.�dadbd^�Z5e.�dcddd^�Z6e.�dedfdC�Z7e.�dgdhdC�Z8e.�didjdk�Z9e.�dldmdC�Z:e.�dndodC�Z;e.�dpdqdC�Z<e.�drdsdC�Z=e.�dtdudC�Z>Gdvdw�dwe?�Z@eAe
�B��ZCe@eCd+d=d?dAdDd_dadcdedgdidldnh
eCd d+d=d?dZdrhdx��ZDdyS)zzDocstring violation definition.�)�	dropwhile)�partial)�
namedtuple�)�is_blank)�Error�
ErrorRegistry�ErrorParams�code�
short_desc�contextc@speZdZdZdZdZdd�Zdd�Zedd��Z	ed	d��Z
ed
d��Zedd
��Zdd�Z
dd�Zdd�ZdS)rzError in docstring style.FcGs(||_||_||_||_d|_d|_dS)zYInitialize the object.

        `parameters` are specific to the created error.

        N)r
rr�
parameters�
definition�explanation)�selfr
rrr
�r�F/opt/alt/python37/lib/python3.7/site-packages/pydocstyle/violations.py�__init__szError.__init__cCs||_||_dS)z+Set the source code context for this error.N)rr)rrrrrr�set_context#szError.set_contextcCs
|jjjS)N)r�module�name)rrrr�<lambda>(�zError.<lambda>cCs|jjS)N)r�start)rrrrr)rcCs:d�|j|j�}|jdk	r6|jj|j�}|d�|�7}|S)z(Return the message to print to the user.z{}: {}Nz ({}))�formatr
rrr
)r�retZspecific_error_msgrrr�message+s

z
Error.messagec	Cs�d}|jj}|jj}tttttt|�����}tt|t|���}d�	|�}xFt
|�D]:\}}|rjd|}||�	|||�7}|dkrV|d7}PqVW|S)z,Return the source code lines for this error.�z{{:{}}}:{{}}� �z        ...
)r�sourcer�list�reversedrr�len�strr�	enumerate)	rr �lines�offsetZlines_strippedZ
numbers_widthZline_format�n�linerrrr&4s

zError.linescs�d�dd��j�d�D���_d}�jr8�jr8|d7}n*�jrN�jsN|d7}n�jrb�jsb|d7}|jft�fdd�d	D���S)
N�
css|]}t|�s|VqdS)N)r)�.0�lrrr�	<genexpr>Hsz Error.__str__.<locals>.<genexpr>z1{filename}:{line} {definition}:
        {message}z

{explanation}

{lines}
z


{lines}
z

{explanation}

c3s|]}|t�|�fVqdS)N)�getattr)r+r)rrrr-Qs)�filenamer)rrrr&)�joinr�splitr �explainr�dict)r�templater)rr�__str__Gs

z
Error.__str__cCst|�S)N)r$)rrrr�__repr__UszError.__repr__cCs|j|jf|j|jfkS)N)r/r))r�otherrrr�__lt__XszError.__lt__N)�__name__�
__module__�__qualname__�__doc__r2r rr�propertyr/r)rr&r5r6r8rrrrrs
	rc@sHeZdZdZgZGdd�de�Zedd��Zedd��Z	edd	��Z
d
S)rz1A registry of all error codes, divided to groups.c@s"eZdZdZdd�Zddd�ZdS)zErrorRegistry.ErrorGroupz#A group of similarly themed errors.cCs||_||_g|_dS)z�Initialize the object.

            `Prefix` should be the common prefix for errors in this group,
            e.g., "D1".
            `name` is the name of the group (its subject).

            N)�prefixr�errors)rr>rrrrrdsz!ErrorRegistry.ErrorGroup.__init__NcCs*t|||�}ttf|��}|j�|�|S)z9Create an error, register it to this group and return it.)r	rrr?�append)rZ
error_codeZ
error_descZ
error_contextZerror_params�factoryrrr�create_errorpsz%ErrorRegistry.ErrorGroup.create_error)N)r9r:r;r<rrBrrrr�
ErrorGroupasrCcCs|�||�}|j�|�|S)z'Create a new error group and return it.)rC�groupsr@)�clsr>r�grouprrr�create_groupyszErrorRegistry.create_groupccs,x&|jD]}x|jD]}|jVqWqWdS)zYield all registered codes.N)rDr?r
)rErF�errorrrr�get_error_codes�szErrorRegistry.get_error_codescCs�d}d}d}x�|jD]z}||7}||7}|dd�|j��d�d7}||7}x>|jD]4}||7}|d|j�d�d	|j�d
�d7}qVWqW||7}|S)z;Output the registry as reStructuredText, for documentation.zQ+------+-----------------------------------------------------------------------+
zQ|                                                                              |
r�|z**{}**�Nz|
�z| �F)rDrr�centerr?r
r�ljust)rEZsep_lineZ
blank_line�tablerFrHrrr�to_rst�s.zErrorRegistry.to_rstN)r9r:r;r<rD�objectrC�classmethodrGrIrQrrrrr\srZD1zMissing Docstrings�D100z"Missing docstring in public module�D101z!Missing docstring in public class�D102z"Missing docstring in public method�D103z$Missing docstring in public function�D104z#Missing docstring in public package�D105z!Missing docstring in magic method�D106z(Missing docstring in public nested class�D107zMissing docstring in __init__ZD2zWhitespace Issues�D200z5One-line docstring should fit on one line with quotesz	found {0}�D201z0No blank lines allowed before function docstring�D202z/No blank lines allowed after function docstring�D203z,1 blank line required before class docstring�D204z+1 blank line required after class docstring�D205z:1 blank line required between summary line and description�D206z2Docstring should be indented with spaces, not tabs�D207zDocstring is under-indented�D208zDocstring is over-indented�D209z@Multi-line docstring closing quotes should be on a separate line�D210z1No whitespaces allowed surrounding docstring text�D211z-No blank lines allowed before class docstring�D212z;Multi-line docstring summary should start at the first line�D213z<Multi-line docstring summary should start at the second line�D214zSection is over-indentedz{0!r}�D215z"Section underline is over-indentedzin section {0!r}ZD3z
Quotes Issues�D300zUse """triple double quotes"""zfound {0}-quotes�D301z*Use r""" if any backslashes in a docstring�D302zUse u""" for Unicode docstringsZD4zDocstring Content Issues�D400z#First line should end with a periodz	not {0!r}�D401z'First line should be in imperative moodz'{0}', not '{1}'z7First line should be in imperative mood; try rephrasingzfound '{0}'�D402z3First line should not be the function's "signature"�D403z;First word of the first line should be properly capitalizedz{0!r}, not {1!r}�D404z0First word of the docstring should not be `This`�D405z+Section name should be properly capitalized�D406z&Section name should end with a newline�D407z&Missing dashed underline after section�D408zDSection underline should be in the line following the section's name�D409z5Section underline should match the length of its namez1Expected {0!r} dashes in section {1!r}, got {2!r}�D410z Missing blank line after section�D411z!Missing blank line before section�D412z?No blank lines allowed between a section header and its content�D413z%Missing blank line after last section�D414zSection has no contentc@seZdZdd�ZdS)�AttrDictcCs||S)Nr)r�itemrrr�__getattr__�szAttrDict.__getattr__N)r9r:r;r�rrrrr~�sr~)Zpep257�numpyN)Er<�	itertoolsr�	functoolsr�collectionsr�utilsr�__all__r	rRrrrGZD1xxrBrTrUrVrWrXrYrZr[ZD2xxr\r]r^r_r`rarbrcrdrerfrgrhrirjrkZD3xxrlrmrnZD4xxrorpZD401brqrrrsrtrurvrwrxryrzr{r|r}r3r~�setrIZ
all_errorsZconventionsrrrr�<module>s�M>