:18dZddlmZddlZddlmZmZmZmZm Z m Z m Z ddl m Z mZddlmZddlmZddlmZdd lmZmZdd lmZe rdd lmZGd d ZdS)zSummary reporting) annotationsN)AnyIOIterableListOptionalTuple TYPE_CHECKING) ConfigError NoDataError)human_sorted_items) FileReporter)get_analysis_to_report)AnalysisNumbers)TMorf)CoveragecTeZdZdZd#dZd$d Zd%d Zd&dZd&dZd'd(dZ d)dZ d*d"Z dS)+SummaryReporterz*A reporter for writing the summary report.coveragerreturnNonech||_|jj|_||_d|_|jjpd|_|jdvrtd|jg|_ d|_ d|_ t|jj |_dS)Ntext>rtotalmarkdownzUnknown report format choice: r) precision)rconfigget_datahas_arcsbranchesoutfileformat output_formatr fr_analysis skipped_count empty_countrrr)selfrs /srv/buildsys-work-dir/castor/build_node/builder-2/WGSG1/unpkd_srcs/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/coverage/report.py__init__zSummaryReporter.__init__s  m*  ))++4466 *. ![/96  %B B BUt?QUUVV V@Bt{'<=== linestrc|jJ|j||jddS)z-Write a line to the output, adding a newline.N )r"writerstrip)r(r,s r)r0zSummaryReporter.write'sJ|''' 4;;==))) 4     r+items Iterable[str]cV|d|dS)z)Write a list of strings, joined together.N)r0join)r(r2s r) write_itemszSummaryReporter.write_items-s$ 2775>>"""""r+header List[str] lines_valuesList[List[Any]] total_line List[Any] end_linesc  td|Ddgzdz tt|ddztddz t gfd|Dz tdd d d d d d  fd D}d|}dt|z}|||| tdd|D]5} fdt|D} || 6|r|| fdt|D} || |D]} || dS)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. c8g|]}t|dS)r)len.0r,s r) z0SummaryReporter._report_text..As">>>DG >>>r+Coverz Covercfg|]-}t|ddz.S)rGrH)rAindex)rCr,r8s r)rDz0SummaryReporter._report_text..Cs7]]]s4 W(=(=#>??!C]]]r+z {:{name_len}}z{:>7}z{:>{n}}z{:>10}NameStmtsMissBranchBrPartrGMissingcLg|] }||!Sname_lennr#rCitemformatsmax_nmax_names r)rDz0SummaryReporter._report_text..MsB    DM E B B   r+r5-z{:>{n}}%rGz {:9})rQcrg|]3\}}|t|dz 4SrFrTr#r-rCrYvaluerZr[r\s r)rDz0SummaryReporter._report_text..[sW2=$ $$SZZ!U1W%..r+crg|]3\}}|t|dz 4Sr`rarbs r)rDz0SummaryReporter._report_text..esW   .9dE DM Uq ! * *   r+N) maxrArJdictr6r0updatezipr7)r(r8r:r<r> header_items header_strrulevalues line_itemsend_linerZr[r\s ` @@@r) _report_textzSummaryReporter._report_text1sX >>>>>!DEEIC 6<<#8#89::Q>H NNQRRUG]]]]P\]]]]^^             WW\** S__$ : 4t*---yAAA" ) )FADVVATATJ   Z ( ( ( (   JJt         =@=T=T    $$$! ! !H JJx  ! !r+c td|Ddttddztddddddd tt||d d ztd fd|D}d|}dddt|ddz dgd|ddDzz}|||||D]X}tdfdt||D} | | Ytddg} t||D]B\} } | dkr| } n| d krd| d} nd| d} | |  | z } C| | |D]}||dS)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. c3hK|]-}t|dddV.dS)r_\_N)rAreplacerBs r) z3SummaryReporter._report_markdown..~s<RRTDGOOC7788RRRRRRr+r)defaultz **TOTAL**rFz| {:{name_len}}|z{:>9} |z {:>{n}} |z{:>10} |rKrGz Cover cLg|] }||!SrSrWrXs r)rDz4SummaryReporter._report_markdown..s3bbbSW ,,TH,NNbbbr+r5| z- |r]cZg|](}dt|dz d)S)z-: |rFr])rjustrA)rCrYs r)rDz4SummaryReporter._report_markdown..s0 I I IV\\#d))A+s + + I I Ir+Nz {:>{n}}% |r^cg|]G\}}|t|dddz HS)rrrsrFrT)r#r-rtrbs r)rDz4SummaryReporter._report_markdown..scD% $$SZZ%7%7U%C%ChZ_`aZa$bbr+z|{:>{name_len}} |)rLrGz **z%**z**rT) rerArfrJr6r|r0rgrhr7r#)r(r8r:r<r>rirjrule_strrlrmtotal_line_itemsrYrcinsertrnrZr[r\s @@@r)_report_markdownz SummaryReporter._report_markdownns RR\RRR\]^^^x[!1!122Q6#   C 6<<#8#89::Q>IOObbbbbb[abbb WW\** 5;;s<?/C/CA/Es#K#K"L I I QRR8H I I I#J    : 8" ) )F NN4l333 4 4 4#&vv#6#6J   Z ( ( ( ( t!4KHHHIII&(vz22 Y YKD%{{)u)))(u  4 4VhRW 4 X X X   )***! ! !H JJx  ! !r+NmorfsOptional[Iterable[TMorf]]r"Optional[IO[str]]floatc|p tj|_|j|jjt|j|D]\}}| |||j j s|j std|jdkr ||j jn||j jS)zWrites a report summarizing coverage statistics per module. `outfile` is a text-mode file object to write the summary to. zNo data to report.r)sysstdoutr"rrset_query_contextsrreport_contextsrreport_one_filern_filesr&r r$r0pc_covered_strtabular_report pc_covered)r(rr"franalysiss r)reportzSummaryReporter.reports ,#*    33DK4OPPP24=%HH / /LB  X . . . .z! 4$*< 4233 3   ( ( JJtz0 1 1 1 1    ! ! !z$$r+cgd}|jr|ddgz }|dgz }|jjr|dgz }tdddd }|jr$|td d g}|jD]\}}|j}||j|j g}|jr||j |j gz }||j gz }|jjr|| dgz }||jgz }|||jjpd}d} |ddkr d} |dd}n|ddkr |dd}||t'd|jj|dkrt)|| }n|fd| d|jj|jj g} |jr| |jj |jj gz } | |jj gz } |jjr| dgz } g} |jjr7|jr0|jdkrdnd} | d|jd| d|jjr7|jr0|jdkrdnd} | d|jd| d |jd!kr|j} n|j} | ||| | dS)"zWrites tabular report formats.)rLrMrNrOrPrGrQrrFrH)namestmtsmisscover)branchbrpartT)r!rFr]N+zInvalid sorting option: )reversec$||dfS)Nr)r,sort_idxs r)z0SummaryReporter.tabular_report..s$x.$q'!:r+)keyrTOTALr5sr/z filez" skipped due to complete coverage.z empty filez skipped.r)r!r show_missingrfrgr%numbersrelative_filename n_statements n_missing n_branchesn_partial_branchesrmissing_formattedrappendsortlowergetr r r skip_coveredr& skip_emptyr'r$rro)r(r8 column_orderr:rrnumsargs sort_optionrr<r> file_suffix formatterrs @r)rzSummaryReporter.tabular_reports+** = + x* *F7) ; # " yk !F!!2>>> = :   Aa 8 8 8 9 9 9 ". & &NR#D((**D,=t~ND} C$*ABB T() )D{' D33T3BBCC T_% %D    % % % %{'1688::  q>S G%abb/KK ^s " "%abb/K##K00  M9IMMNN N & -lGLLLLL   ::::     tz6 8LM = Q 4:0$*2OP PJtz011 ; #  2$ J ; # (: !%!3A!5!5##2K   ]T']]k]]]    ; ! Wd&6 W!%!1A!5!5##2K   U$"2UU{UUU V V V   + +-II)I &, I>>>>>r+rrrrc.|j}|xj|z c_|jdk}|jdk}|jjr|r|r|xjdz c_dS|jjr|jdkr|xj dz c_ dS|j ||fdS)z4Report on just one file, the callback from report().rrFN) rrrrrrr&rrr'r%r)r(rrrno_missing_linesno_missing_branchess r)rzSummaryReporter.report_one_file s d  Na/#6!; ; # 4(8 4=P 4   ! #     [ # 4(9Q(>(>    !       # #RN 3 3 3 3 3r+)rrrr)r,r-rr)r2r3rr) r8r9r:r;r<r=r>r9rr)N)rrr"rrr)rr)rrrrrr) __name__ __module__ __qualname____doc__r*r0r7rorrrrrr+r)rrs44 > > > >!!!! ####;!;!;!;!z<!<!<!<!|%%%%%,G?G?G?G?R444444r+r)r __future__rrtypingrrrrrr r coverage.exceptionsr r coverage.miscr coverage.pluginrcoverage.report_corercoverage.resultsrrcoverage.typesrrrrrr+r)rs,"""""" JJJJJJJJJJJJJJJJJJ88888888,,,,,,((((((777777........ "!!!!!!B4B4B4B4B4B4B4B4B4B4r+