ZL i| dZddlmZddlmZddlmZddlmZddl m Z m Z GddeZ Gd d e ZeGd d Zy )z Summarize Black runs to users. ) dataclass)Enum)Path)style)erroutceZdZdZdZdZy)ChangedrN)__name__ __module__ __qualname__NOCACHEDYESR/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/black/report.pyr r s B F Crr ceZdZdZy)NothingChangedz3Raised when reformatted code is the same as source.N)r rr__doc__rrrrrs=rrceZdZUdZdZeed<dZeed<dZeed<dZ eed<dZ e ed<dZ e ed <dZ e ed <d ed ed dfdZd eded dfdZdeded dfdZed e fdZd efdZy)ReportzDProvides a reformatting counter. Can be rendered with `str(report)`.Fcheckdiffquietverboser change_count same_count failure_countsrcchangedreturnNcr|tjurZ|js |jrdnd}|js |j st |d||xjdz c_y |jr*|tjur|d}n|d}t |d|xjdz c_ y ) zGIncrement the counter for successful reformatting. Write out a message.zwould reformat reformatted r z" already well formatted, good job.z( wasn't modified on disk since last run.FboldN) r rrrrrrrrr )selfr"r#r&msgs rdonez Report.done$s gkk !.2jjDII*=K||4::{m1SE*+    " ||gjj( E!CDC E!IJCCe$ OOq OrmessagecPtd|d||xjdz c_y)zCIncrement the counter for failed reformatting. Write out a message.zerror: cannot format z: r N)rr!)r*r"r-s rfailedz Report.failed4s) #C57) 45 arpathcB|jrt|d|dyy)Nz ignored: Fr()rr)r*r0r-s r path_ignoredzReport.path_ignored9s# << 4& 7),5 9 rcP|jry|jr |jryy)aReturn 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!rr)r*s r return_codezReport.return_code=s%      4::rc d|js |jrd}d}d}nd}d}d}g}|jrO|jdkDrdnd }|jt |jd |d d d t |d z|j rB|j dkDrdnd }|jt |j d |d d |z|j rA|j dkDrdnd }|jt |j d |d |ddj|dzS)zcRender a color report of the current state. Use `click.unstyle` to remove colors. zwould be reformattedzwould be left unchangedzwould fail to reformatr&zleft unchangedzfailed to reformatr sz filer'Tblue)r)fgr()r:redz, .)rrrappendrr r!join)r*r& unchangedr/reportr7s r__str__zReport.__str__Ps/ ::0K1I-F'K(I)F   ((1,"A MM**+515DVL;-t45  ??*A MM%4??"351 =&IIU V   ))A-2A MM%4#5#5"6eA3ax HUS Tyy 3&&r)r rrrrbool__annotations__rrrrintr r!rr r,strr/r2propertyr5rArrrrrsNE4D$E4GTL#JM3!!w!4!  $   ::::S$''rrN)r dataclassesrenumrpathlibrclickr black.outputrrr UserWarningrrrrrrMsO"! d >[> R'R' R'r