o
    ^’i|  ã                   @   sz   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„ deƒZG d	d
„ d
eƒZeG dd„ dƒƒZdS )z 
Summarize Black runs to users.
é    )Ú	dataclass)ÚEnum)ÚPath)Ústyle)ÚerrÚoutc                   @   s   e Zd ZdZdZdZdS )ÚChangedr   é   é   N)Ú__name__Ú
__module__Ú__qualname__ÚNOÚCACHEDÚYES© r   r   úQ/var/www/html/stock_analysis/be/venv/lib/python3.10/site-packages/black/report.pyr      s    r   c                   @   s   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   c                   @   sÈ   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d„Zdededdfdd„Zdededdfdd„Zedefdd„ƒZdefd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                 C   s’   |t ju r'| js| jrdnd}| js| jst|› d|› ƒ |  jd7  _d	S | jr@|t ju r5|› d}n|› d}t|dd |  j	d7  _	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    Úmsgr   r   r   Údone$   s   


zReport.doneÚmessagec                 C   s&   t d|› d|› ƒ |  jd7  _dS )zCIncrement the counter for failed reformatting. Write out a message.zerror: cannot format z: r	   N)r   r   )r$   r   r'   r   r   r   Úfailed4   s   zReport.failedÚpathc                 C   s$   | j rt|› d|› dd d S d S )Nz
 ignored: Fr"   )r   r   )r$   r)   r'   r   r   r   Úpath_ignored9   s   ÿzReport.path_ignoredc                 C   s   | 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$   r   r   r   Úreturn_code=   s
   zReport.return_codec                 C   sø   | j s| jrd}d}d}nd}d}d}g }| jr9| jdkrdnd	}| t| j› d
|› ddddt|› dd ¡ | jrW| jdkrCdnd	}| t| j› d
|› ddd| ¡ | jru| jdkradnd	}| t| j› d
|› d|› dd¡ d |¡d 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"   )r0   Úredz, Ú.)r   r   r   Úappendr   r   r   Újoin)r$   r    Ú	unchangedr(   Úreportr-   r   r   r   Ú__str__P   s,   ÿÿ$$zReport.__str__)r   r   r   r   r   ÚboolÚ__annotations__r   r   r   r   Úintr   r   r   r   r&   Ústrr(   r*   Úpropertyr,   r7   r   r   r   r   r      s   
 r   N)r   Údataclassesr   Úenumr   Úpathlibr   Úclickr   Úblack.outputr   r   r   ÚUserWarningr   r   r   r   r   r   Ú<module>   s    