
    h|                         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y)z 
Summarize Black runs to users.
    )	dataclass)Enum)Path)style)erroutc                       e Zd ZdZdZdZy)Changedr         N)__name__
__module____qualname__NOCACHEDYES     ?/var/www/html/immo/lib/python3.12/site-packages/black/report.pyr
   r
      s    	
BF
Cr   r
   c                       e Zd ZdZy)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y)ReportzDProvides a reformatting counter. Can be rendered with `str(report)`.Fcheckdiffquietverboser   change_count
same_countfailure_countsrcchangedreturnNc                 r   |t         j                  u rZ| j                  s| j                  rdnd}| j                  s| j
                  st        | d|        | xj                  dz  c_        y	| j                  r*|t         j                  u r| d}n| d}t        |d       | xj                  dz  c_	        y	)
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    gkk!.2jjDII*=K||4::{m1SE*+"||gjj( E!CDC E!IJCCe$OOq Or   messagec                 P    t        d| d|        | xj                  dz  c_        y)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.failed4   s)    #C57)45ar   pathc                 B    | j                   rt        | d| d       y y )Nz
 ignored: Fr(   )r   r   )r*   r0   r-   s      r   path_ignoredzReport.path_ignored9   s#    <<4&
7),59 r   c                 P    | j                   ry| j                  r| j                  ryy)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=   s%     4::r   c           	      d   | j                   s| j                  rd}d}d}nd}d}d}g }| j                  rO| j                  dkD  rdnd	}|j                  t	        | j                   d
| ddd      t	        | d      z          | j
                  rB| j
                  dkD  rdnd	}|j                  t	        | j
                   d
| dd      |z          | j                  rA| j                  dkD  rdnd	}|j                  t	        | j                   d
| d| d             dj                  |      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__P   s/   
 ::0K1I-F'K(I)F((1,"AMM**+515DVL;-t45
 ??*AMM%4??"351 =&IIUV))A-2AMM%4#5#5"6eA3ax HUS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      s    NE4D$E4GTL#JM3! !w !4 !  $      
: : : : S  $' 'r   r   N)r   dataclassesr   enumr   pathlibr   clickr   black.outputr   r   r
   UserWarningr   r   r   r   r   <module>rM      sO    "    !d >[ > R' R' R'r   