
     h                        S r SSKJr  SSKrSSKrSSKJr  SSKJr  SSK	J
r
  SSKJrJr  SSKJr  SS	KJr  SS
KJr  SSKJr  \(       a  SSKJr  \" \5      r " S S5      rg)z'Source file annotation for coverage.py.    )annotationsN)Iterable)TYPE_CHECKING)flat_rootname)
ensure_dirisolate_module)FileReporter)get_analysis_to_report)Analysis)TMorf)Coveragec                      \ rS rSrSrS
S jr\R                  " S5      r\R                  " S5      r	SSS jjr
SS jrS	rg)AnnotateReporter   a  Generate annotated source files showing line coverage.

This reporter creates annotated copies of the measured source files. Each
.py file is copied as a .py,cover file, with a left-hand margin annotating
each line::

    > def h(x):
    -     if 0:   #pragma: no cover
    -         pass
    >     if x == 1:
    !         a = 1
    >     else:
    >         a = 2

    > h(2)

Executed lines use ">", lines not executed use "!", lines excluded from
consideration use "-".

c                T    Xl         U R                   R                  U l        S U l        g N)coverageconfig	directory)selfr   s     o/root/racknerd_01/codex-conversation/amazon-q-terraform/.venv/lib/python3.13/site-packages/coverage/annotate.py__init__AnnotateReporter.__init__0   s     mm**%)    z\s*(#|$)z\s*else\s*:\s*(#|$)Nc                    X l         U R                  R                  5         [        U R                  U5       H  u  p4U R	                  X45        M     g)z9Run the report.

See `coverage.report()` for arguments.

N)r   r   get_datar
   annotate_file)r   morfsr   franalysiss        r   reportAnnotateReporter.report8   s?     # 24==%HLBr, Ir   c                   [        UR                  5      n[        UR                  5      n[        UR                  5      nU R                  (       aw  [        U R                  5        [        R                  R                  U R                  [        UR                  5       5      5      nUR                  S5      (       d   eUSS S-   nOUR                  nUS-  n[        USSS9 nS	=pS
n
UR                  5       n[        UR!                  S
5      SS9 GH  u  pU[#        U5      :  a&  X8   U:  a  US-  nU[#        U5      :  a
  X8   U:  a  M  U	[#        U5      :  a&  XI   U:  a  U	S-  n	U	[#        U5      :  a
  XI   U:  a  M  U[#        U5      :  a$  X8   U:X  a  U	[#        U5      :  =(       d    XI   U:  n
U R$                  R'                  U5      (       a  UR)                  S5        OU R*                  R'                  U5      (       aO  U	[#        U5      :  a  UR)                  S5        OoX8   XI   :X  a  UR)                  S5        OSUR)                  S5        OAX;   a  UR)                  S5        O*U
(       a  UR)                  S5        OUR)                  S5        UR)                  U5        GM     SSS5        g! , (       d  f       g= f)zMAnnotate a single file.

`fr` is the FileReporter for the file to annotate.

_pyNz.pyz,coverwzutf-8)encodingr   T   )startz  z> z! z- )sorted
statementsmissingexcludedr   r   ospathjoinr   relative_filenameendswithfilenameopensource	enumerate
splitlineslenblank_rematchwriteelse_re)r   r   r    r+   r,   r-   	dest_filedestijcoveredr5   linenolines                 r   r   AnnotateReporter.annotate_fileC   s;    H//0
))*(++,>>t~~&T^^]2CWCWCY5Z[I%%e,,,,!#2.IIX	)S73tIAGYY[F )&*;*;D*A K#j/)jmf.DFA #j/)jmf.D#g,&7:+>FA #g,&7:+>s:&:=F+B3w</F7:3FG==&&t,,JJt$\\''--CL(

4(#'*4

4(

4('JJt$JJt$JJt$

4 1 !L	 433s   $A(J73J7D+J77
K)r   r   r   )r   r   returnNoner   )r   zIterable[TMorf] | Noner   z
str | NonerE   rF   )r   r	   r    r   rE   rF   )__name__
__module____qualname____firstlineno____doc__r   recompiler9   r<   r!   r   __static_attributes__ r   r   r   r      s5    **
 zz+&Hjj/0G	-/!r   r   )rK   
__future__r   r.   rL   collections.abcr   typingr   coverage.filesr   coverage.miscr   r   coverage.pluginr	   coverage.report_corer
   coverage.resultsr   coverage.typesr   r   r   r   rO   r   r   <module>rY      sG    . " 	 	 $   ( 4 ( 7 %  !BX! X!r   