
    c                        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 eD             Z G d dej	                  Z
 G d de
          Z G d de
          Z G d de
          Z G 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                    i | ]}|d S )  ).0ks     9lib/python3.11/site-packages/flake8/formatting/default.py
<dictcomp>r      s    $$$a$$$    c                  &    e Zd ZU dZde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                ~    | j         |j        |j        |j        |j        |j        d| j        rt          nt          z  S )zFormat 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   s     r   formatzSimpleFormatter.format(   sN      JJN$&$
 $
 3vv$
 
 	
r   Nr   r   r   r   )__name__
__module____qualname____doc____annotations__r-   r   r   r   r   r      sB           
 
 
 
 
 
r   r   c                      e Zd ZdZdZddZdS )DefaultzDefault 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                p    | j         j                                        dk    r| j         j        | _        dS dS )z!Check for a custom format string.defaultN)optionsr-   lowerr   r,   s    r   
after_initzDefault.after_initE   s=    <$$&&)3 	4 $ 3D	4 	4r   Nr   r6   )r/   r0   r1   r2   r   r<   r   r   r   r5   r5   8   s<         	4 4 4 4 4 4 4r   r5   c                      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/   r0   r1   r2   r   r   r   r   r?   r?   K   s        &&:LLLr   r?   c                  8     e Zd ZdZdZddZdd	Zd fd
Z xZS )FilenameOnlyz&Only print filenames, e.g., flake8 -q.z%(path)sr   r6   c                ,    t                      | _        dS )z Initialize our set of filenames.N)setfilenames_already_printedr;   s    r   r<   zFilenameOnly.after_initV   s    3655&&&r   r   r   r   c                    dS )zDo not include the source code.Nr   r+   s     r   show_sourcezFilenameOnly.show_sourceZ         r   c                    |j         | j        vr@| j                            |j                    t                                          |          S dS )z%Ensure we only print each error once.N)r%   rD   addsuperr-   )r,   r   	__class__s     r   r-   zFilenameOnly.format]   sI    >!?? 	*..u~>>>77>>%(((4r   r=   r.   )	r/   r0   r1   r2   r   r<   rF   r-   __classcell__)rK   s   @r   rA   rA   Q   sp        00L9 9 9 9. . . .         r   rA   c                  "    e Zd ZdZd	dZd	dZdS )
NothingzPrint absolutely nothing.r   r   r   r   c                    dS )zDo nothing.Nr   r+   s     r   r-   zNothing.formati   rG   r   c                    dS )zDo not print the source.Nr   r+   s     r   rF   zNothing.show_sourcel   rG   r   Nr.   )r/   r0   r1   r2   r-   rF   r   r   r   rN   rN   f   sB        ##   ' ' ' ' ' 'r   rN   N)r2   
__future__r   flake8.formattingr   flake8.violationr   r)   r*   BaseFormatterr   r5   r?   rA   rN   r   r   r   <module>rU      se   * * " " " " " " " " " " " " & & & & & & 
 
 %$V$$$

 
 
 
 
d( 
 
 
D4 4 4 4 4o 4 4 4&; ; ; ; ;_ ; ; ;    ?   *' ' ' ' 'd  ' ' ' ' 'r   