o
    ÕÜÓhñ  ã                   @  s¨   d Z ddlmZ ddlmZ ddlmZ ddddd	d
dddddœ
Zdd„ eD ƒZG dd„ dej	ƒZ
G dd„ de
ƒZG dd„ de
ƒZG dd„ de
ƒZG dd„ dej	ƒZdS )z$Default formatting class for Flake8.é    )Úannotations)Úbase)Ú	Violationz[1mz[30mz[31mz[32mz[33mz[34mz[35mz[36mz[37mz[m)
ÚboldÚblackÚredÚgreenÚyellowÚblueÚmagentaÚcyanÚwhiteÚresetc                 C  s   i | ]}|d “qS )Ú © )Ú.0Úkr   r   úO/var/www/html/ai/venv/lib/python3.10/site-packages/flake8/formatting/default.pyÚ
<dictcomp>   s    r   c                   @  s$   e Zd ZU dZded< ddd	„Zd
S )ÚSimpleFormatteray  Simple abstraction for Default and Pylint formatter commonality.

    Sub-classes of this need to define an ``error_format`` attribute in order
    to succeed. The ``format`` method relies on that attribute and expects the
    ``error_format`` string to use the old-style formatting strings with named
    parameters:

    * code
    * text
    * path
    * row
    * col

    ÚstrÚerror_formatÚerrorr   Úreturnú
str | Nonec                 C  s2   | j |j|j|j|j|jdœ| jrt¥ S t¥ S )z´Format and write error out.

        If an output filename is specified, write formatted errors to that
        file. Otherwise, print the formatted error to standard out.
        )ÚcodeÚtextÚpathÚrowÚcol)	r   r   r   ÚfilenameÚline_numberÚcolumn_numberÚcolorÚCOLORSÚ
COLORS_OFF©Úselfr   r   r   r   Úformat(   s   ûúúzSimpleFormatter.formatN©r   r   r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú__annotations__r(   r   r   r   r   r      s   
 r   c                   @  s   e Zd ZdZdZddd„ZdS )	ÚDefaultzƒDefault formatter for Flake8.

    This also handles backwards compatibility for people specifying a custom
    format string.
    z‡%(bold)s%(path)s%(reset)s%(cyan)s:%(reset)s%(row)d%(cyan)s:%(reset)s%(col)d%(cyan)s:%(reset)s %(bold)s%(red)s%(code)s%(reset)s %(text)sr   ÚNonec                 C  s"   | j j ¡ dkr| j j| _dS dS )z!Check for a custom format string.ÚdefaultN)Úoptionsr(   Úlowerr   ©r'   r   r   r   Ú
after_initE   s   ÿzDefault.after_initN©r   r0   )r*   r+   r,   r-   r   r5   r   r   r   r   r/   8   s
    ÿr/   c                   @  s   e Zd ZdZdZdS )ÚPylintzPylint formatter for Flake8.z%%(path)s:%(row)d: [%(code)s] %(text)sN)r*   r+   r,   r-   r   r   r   r   r   r7   K   s    r7   c                      s:   e Zd ZdZdZddd„Zdd
d„Zd‡ fdd„Z‡  ZS )ÚFilenameOnlyz&Only print filenames, e.g., flake8 -q.z%(path)sr   r0   c                 C  s   t ƒ | _dS )z Initialize our set of filenames.N)ÚsetÚfilenames_already_printedr4   r   r   r   r5   V   s   zFilenameOnly.after_initr   r   r   c                 C  ó   dS )zDo not include the source code.Nr   r&   r   r   r   Úshow_sourceZ   ó    zFilenameOnly.show_sourcec                   s*   |j | jvr| j |j ¡ tƒ  |¡S dS )z%Ensure we only print each error once.N)r    r:   ÚaddÚsuperr(   r&   ©Ú	__class__r   r   r(   ]   s   zFilenameOnly.formatr6   r)   )	r*   r+   r,   r-   r   r5   r<   r(   Ú__classcell__r   r   r@   r   r8   Q   s    

r8   c                   @  s$   e Zd ZdZddd„Zddd	„Zd
S )ÚNothingzPrint absolutely nothing.r   r   r   r   c                 C  r;   )zDo nothing.Nr   r&   r   r   r   r(   i   r=   zNothing.formatc                 C  r;   )zDo not print the source.Nr   r&   r   r   r   r<   l   r=   zNothing.show_sourceNr)   )r*   r+   r,   r-   r(   r<   r   r   r   r   rC   f   s    
rC   N)r-   Ú
__future__r   Úflake8.formattingr   Úflake8.violationr   r$   r%   ÚBaseFormatterr   r/   r7   r8   rC   r   r   r   r   Ú<module>   s*    ö"