
    c                        d dl mZ d dlZd dlZd dlZd dlmZmZ d dlmZ d dl	m
Z
 d dlmZ d dlmZ erd dlmZ d d	lmZ  G d
 d          ZdS )    )annotationsN)TYPE_CHECKINGTextIO)warn)Message)Text)LinterStats)PyLinter)Sectionc                  j    e Zd ZdZdZdZ	 d d!d	Zd"dZd d!dZd#d$dZ	d%dZ
d%dZd&dZd'dZd(dZdS ))BaseReporterzTBase class for reporters.

    symbols: show short symbolic names for messages.
     baseNoutputTextIO | NonereturnNonec                    t          | dd           rt          j        dt          d           |  d| _        |pt
          j        | _        g | _        t          j
                    t          j        z   | _        d S )N__implements__zUsing the __implements__ inheritance pattern for BaseReporter is no longer supported. Child classes should only inherit BaseReporter   
stacklevelr   )getattrwarningsr   DeprecationWarningsectionsysstdoutoutmessagesosgetcwdseppath_strip_prefixselfr   s     >lib/python3.11/site-packages/pylint/reporters/base_reporter.py__init__zBaseReporter.__init__!   s{    4)400 	MS"	    	!/SZ')!#rv!5    msgr   c                :    | j                             |           dS )z3Handle a new message triggered on the current file.N)r    append)r&   r*   s     r'   handle_messagezBaseReporter.handle_message0   s    S!!!!!r)   c                Z    t          dt          d           |pt          j        | _        dS )zSet output stream.zO'set_output' will be removed in 3.0, please use 'reporter.out = stream' insteadr   r   N)r   r   r   r   r   r%   s     r'   
set_outputzBaseReporter.set_output4   s8     	]	
 	
 	
 	

 'SZr)   stringstrc                2    t          || j                   dS )z"Write a line in the output buffer.)fileN)printr   )r&   r0   s     r'   writelnzBaseReporter.writeln>   s    f48$$$$$$r)   layoutr   c                F   d| _         |j        r}t          |j        d         j        d         t                    r0|j        d         j        d         xj        d|j         dz  c_        n"t          d|j        d         j                   |                     |           dS )z0Display results encapsulated in the layout tree.r   z ()zIncorrect child for N)r   	report_id
isinstancechildrenr   data
ValueError_displayr&   r6   s     r'   display_reportszBaseReporter.display_reportsB   s     	W&/!,5a8$?? W"+A.337OF<L7O7O7OO333 !U8J8S!U!UVVVfr)   c                    t                      )zDisplay the layout.)NotImplementedErrorr?   s     r'   r>   zBaseReporter._displayL   s    !###r)   Section | Nonec                    dS )a  Hook for displaying the messages of the reporter.

        This will be called whenever the underlying messages
        needs to be displayed. For some reporters, it probably
        doesn't make sense to display messages as soon as they
        are available, so some mechanism of storing them could be used.
        This method can be implemented to display them after they've
        been aggregated.
        N r?   s     r'   display_messageszBaseReporter.display_messagesP         r)   modulefilepath
str | Nonec                    dS )z0Hook called when a module starts to be analysed.NrE   )r&   rH   rI   s      r'   on_set_current_modulez"BaseReporter.on_set_current_module]   rG   r)   statsr	   previous_statsLinterStats | Nonec                    dS )z-Hook called when a module finished analyzing.NrE   )r&   rM   rN   s      r'   on_closezBaseReporter.on_close`   rG   r)   )N)r   r   r   r   )r*   r   r   r   )r   )r0   r1   r   r   )r6   r   r   r   )r6   rC   r   r   )rH   r1   rI   rJ   r   r   )rM   r	   rN   rO   r   r   )__name__
__module____qualname____doc__	extensionnamer(   r-   r/   r5   r@   r>   rF   rL   rQ   rE   r)   r'   r   r      s         
 ID6 6 6 6 6" " " "( ( ( ( (% % % % %   $ $ $ $	 	 	 	? ? ? ?< < < < < <r)   r   )
__future__r   r!   r   r   typingr   r   r   pylint.messager   pylint.reporters.ureports.nodesr   pylint.utilsr	   pylint.lint.pylinterr
   r   r   rE   r)   r'   <module>r^      s   
 # " " " " " 				 



  ( ( ( ( ( ( ( (       " " " " " " 0 0 0 0 0 0 $ $ $ $ $ $ 8------777777O< O< O< O< O< O< O< O< O< O<r)   