L iB*dZddlmZddlZddlmZddlmZmZm Z ddl m Z m Z ddl mZmZddlmZdd lmZdd lmZmZdd lmZerdd lmZGd dZy)zSummary reporting) annotationsN)Iterable)IO TYPE_CHECKINGAny) ConfigError NoDataError)human_sorted_itemsplural) FileReporter)get_analysis_to_report)AnalysisNumbers)TMorf)CoverageczeZdZdZd dZd dZd dZ ddZ ddZdddZ dd Z dd Z y)SummaryReporterz*A reporter for writing the summary report.c||_|jj|_|jj|_d|_|jj xsd|_|jdvrtd|jg|_ d|_ d|_ t|jj|_y)Ntext>rtotalmarkdownzUnknown report format choice: r) precision)coverageconfigget_datahas_arcsbranchesoutfileformat output_formatr fr_analyses skipped_count empty_countrrr)selfrs U/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/coverage/report.py__init__zSummaryReporter.__init__s  mm**  ))+446 '+ ![[//96   %B B >t?Q?Q>TUV V@Bt{{'<'<= c|jJ|jj|j|jjdy)z-Write a line to the output, adding a newline.N )rwriterstrip)r$lines r%r*zSummaryReporter.write's<||''' 4;;=) 4 r'cD|jdj|y)z)Write a list of strings, joined together.N)r*join)r$itemss r% write_itemszSummaryReporter.write_items-s 2775>"r'c  t|Dcgc]}t|dc}dgzdztt||jddztddz t g|Dcgc]"}t||jddz$c}z tdddddd d  |Dcgc]} |j | }}d j |}dt|z} |j ||j |  jtdd|D](} |j fdt|| D*|r|j | |j fdt||D|D]} |j | ycc}wcc}wcc}w)a:Internal method that prints report data in text format. `header` is a list with captions. `lines_values` is list of lists of sortable values. `total_line` is a list with values of the total line. `end_lines` is a list of ending lines with information about skipped files. rCoverz Coverz {:{name_len}}z{:>7}z{:>{n}}z{:>10}NameStmtsMissBranchBrPartr5Missingname_lennr.-z{:>{n}}%z {:9})r5r=c3jK|]*\}}|jt|dz ,ywr4r>Nrstr.0itemvalueformatsmax_nmax_names r% z.SummaryReporter.report_text..^s<#eDM((Uh%RS)(T03c3jK|]*\}}|jt|dz ,ywrCrDrFs r%rMz.SummaryReporter.report_text..is; D% $$SZ(eai$P rNN) maxlenindexdictrr/r*updater1zip)r$header lines_values total_line end_linesr,rH header_items header_strrulevaluesend_linerJrKrLs @@@r% report_textzSummaryReporter.report_text1s >DG >!DEIC 6<<#89:Q>H NQRRUGP\]s4 W(=#>?!C]]^  \bbSW ,,TH,Nb bWW\* S_$ : 4   !  # F   '*66':    JJt   #&vz#:  " !H JJx  !]?]csF31'F8 7F=c $td|Ddttddztddddddd tt||jd d ztd |Dcgc]}|j |}}dj |}ddj dj t|ddz dg|ddDcgc] }dj t|dz d"c}zz}|j||j||D]C} jtd|jfdt|| DEjtddg} t||D]9\}} | dk(r| } n|d k(rd| d} nd| d} | |j | z } ;|j| |D]} |j| ycc}wcc}w)aTInternal method that prints report data in markdown format. `header` is a list with captions. `lines_values` is a sorted list of lists containing coverage information. `total_line` is a list with values of the total line. `end_lines` is a list of ending lines with information about skipped files. c3XK|]"}t|djdd$yw)r_\_N)rQreplace)rGr,s r%rMz2SummaryReporter.report_markdown..s$RTDGOOC78Rs(*r)defaultz **TOTAL**r4z| {:{name_len}}|z{:>9} |z {:>{n}} |z{:>10} |r7r5z Cover r>r.| z- |rANz-: |z {:>{n}}% |)r5c3K|]:\}}|jt|jdddz <yw)rbrcr4r>N)rrErdrFs r%rMz2SummaryReporter.report_markdown..sP$eDM((E **36UUVY)sAAz|{:>{name_len}} |)r8r5z **z%**z**) rPrQrSrRrr/rjustr*rTr1rU)r$rVrWrXrYrHrZr[rule_strr]total_line_itemsrIinsertr^rJrKrLs @@@r%report_markdownzSummaryReporter.report_markdownrsB R\R\]^x[!12Q6# C 6<<#89:Q>IO[abSW ,,TH,Nb bWW\*  [[\!_-13 7 8z0SummaryReporter.tabular_report..s$x.$q'!:r')keyrTOTALr.filer)rhz" skipped due to complete coverage.z empty z skipped.r)rr show_missingrSrTr!numbersrelative_filename n_statements n_missing n_branchesn_partial_branchesrvmissing_formattedrxappendsortlowergetrr r skip_coveredr"r skip_emptyr#r rnr_)r$rV column_orderrWrzr{numsargs sort_optionrrXrYfiles formatterrs @r%rwzSummaryReporter.tabular_reports>+ == x* *F7) ;; # # yk !F!!2> ==   Aa 8 9  ,, &LB##D((*D,=,=t~~ND}}$*A*ABB T(() )D{{''33T3BCC T__% %D    % &{{''1688:  q>S G%ab/K ^s "%ab/K##K0   89I9I8LMN N & -lGLL   :   tzz66 8L8LM == 4::00$**2O2OP PJtzz0011 ;; # # 2$ J ;; # #(:(:4--v6E   T''(%0RS  ;; ! !d&6&64++V4E   r$"2"2!375'K L    +,,I((I&, I>r'c|j}|xj|z c_|jdk(}|jdk(}|jj r|r|r|xj dz c_y|jjr%|jdk(r|xjdz c_ y|jj||fy)z4Report on just one file, the callback from report().rr4N) rrrrrrr"rrr#r!r)r$rzr{rno_missing_linesno_missing_branchess r%rtzSummaryReporter.report_one_files d  NNa/#66!; ;; # #(8=P   ! #  [[ # #(9(9Q(>    !     # #RN 3r')rrreturnNone)r,rErr)r0z Iterable[str]rr) rV list[str]rWzlist[list[Any]]rXz list[Any]rYrrr)N)ryzIterable[TMorf] | NonerzIO[str] | Nonerfloat)rr)rzr r{rrr) __name__ __module__ __qualname____doc__r&r*r1r_rnr|rwrtrr'r%rrs4 >! #?!?!&?! ?!  ?!  ?!BJ!J!&J! J!  J!  J!X%,F?P4r'r)r __future__rrpcollections.abcrtypingrrrcoverage.exceptionsrr coverage.miscr r coverage.pluginr coverage.report_corer coverage.resultsrrcoverage.typesrrrrrr'r%rs=" $))84(7. !S4S4r'