
    !.d{                         d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
mZ  G d de          Z G d	 d
e          Ze G d d                      ZdS )z 
Summarize Black runs to users.
    )	dataclass)Enum)Path)style)erroutc                       e Zd ZdZdZdZdS )Changedr         N)__name__
__module____qualname__NOCACHEDYES     ,lib/python3.11/site-packages/black/report.pyr
   r
      s        	
BF
CCCr   r
   c                       e Zd ZdZdS )NothingChangedz3Raised when reformatted code is the same as source.N)r   r   r   __doc__r   r   r   r   r      s        ====r   r   c                       e Zd ZU dZdZeed<   dZeed<   dZeed<   dZ	eed<   dZ
eed<   dZeed	<   dZeed
<   dededdfdZdededdfdZdededdfdZedefd            ZdefdZdS )ReportzDProvides a reformatting counter. Can be rendered with `str(report)`.Fcheckdiffquietverboser   change_count
same_countfailure_countsrcchangedreturnNc                 0   |t           j        u rF| j        s| j        rdnd}| j        s| j        st          | d|            | xj        dz  c_        d	S | j        r*|t           j        u r| d}n| d}t          |d           | xj	        dz  c_	        d	S )
zGIncrement the counter for successful reformatting. Write out a message.zwould reformatreformatted r   z" already well formatted, good job.z( wasn't modified on disk since last run.FboldN)
r
   r   r   r   r   r   r   r   r   r    )selfr"   r#   r&   msgs        r   donezReport.done#   s    gk!!.2jXDIX**=K| ,4: ,{**S**+++"| %gj(( DDDCC JJJCCe$$$$OOq OOOOr   messagec                 P    t          d| d|            | xj        dz  c_        dS )zCIncrement the counter for failed reformatting. Write out a message.zerror: cannot format z: r   N)r   r!   )r*   r"   r-   s      r   failedzReport.failed3   s;    4C44744555ar   pathc                 D    | j         rt          | d| d           d S d S )Nz
 ignored: Fr(   )r   r   )r*   r0   r-   s      r   path_ignoredzReport.path_ignored8   s=    < 	:4,,7,,5999999	: 	:r   c                 8    | j         rdS | j        r	| j        rdS dS )a  Return the exit code that the app should use.

        This considers the current state of changed files and failures:
        - if there were any failures, return 123;
        - if any files were changed and --check is being used, return 1;
        - otherwise return 0.
        {   r   r   )r!   r   r   )r*   s    r   return_codezReport.return_code<   s2      	3 	4: 	1qr   c           	      <   | j         s| j        rd}d}d}nd}d}d}g }| j        rR| j        dk    rdnd	}|                    t	          | j         d
| ddd          t	          | d          z              | j        rA| j        dk    rdnd	}|                    t	          | j         d
| dd          |z              | j        r@| j        dk    rdnd	}|                    t	          | j         d
| d| d                     d                    |          dz   S )zcRender a color report of the current state.

        Use `click.unstyle` to remove colors.
        zwould be reformattedzwould be left unchangedzwould fail to reformatr&   zleft unchangedzfailed to reformatr   s z filer'   Tblue)r)   fgr(   )r:   redz, .)r   r   r   appendr   r    r!   join)r*   r&   	unchangedr/   reportr7   s         r   __str__zReport.__str__O   s{   
 : 	* 	*0K1I-FF'K(I)F 	(1,,"AMM*55555DVLLL;(t4445  
 ? 	W**AMM%4? = = = = =&IIIIUVVV 	U)A--2AMM%4#5 H HA H H H HUSSSTTTyy  3&&r   )r   r   r   r   r   bool__annotations__r   r   r   r   intr    r!   r   r
   r,   strr/   r2   propertyr5   rA   r   r   r   r   r      sI        NNE4D$E4GTL#JM3! !w !4 ! ! ! !  $            
: : : : : : : S    X$' ' ' ' ' ' 'r   r   N)r   dataclassesr   enumr   pathlibr   clickr   black.outputr   r   r
   UserWarningr   r   r   r   r   <module>rM      s    " ! ! ! ! !                   ! ! ! ! ! ! ! !    d   > > > > >[ > > > R' R' R' R' R' R' R' R' R' R'r   