
    yIfN                        d Z ddlmZ ddlZddlmZmZmZ ddlm	Z	 ddl
mZmZ erddlmZ ddZddZdddZej        dfddZdS )z?Various helper functions to create the docs of a linter object.    )annotationsN)TYPE_CHECKINGAnyTextIO)MAIN_CHECKER_NAME)get_rst_sectionget_rst_title)PyLinterlinterr
   returndict[str, dict[str, Any]]c                   i }|                                  D ]}|j        }|t          k    r	 |||         d<   ||         dxx         |                                z  cc<   ||         d                             |j                   ||         dxx         |j        z  cc<   # t          $ rP |t          |                                          t          |j                  t          |j                  d||<   Y w xY w|S )z,Get info from a checker and handle KeyError.checkeroptionsmsgsreports)r   r   r   r   )
get_checkersnamer   _options_and_valuesupdater   r   KeyErrorlistdict)r   
by_checkerr   r   s       E/var/www/piapp/venv/lib/python3.11/site-packages/pylint/utils/docs.py_get_checkers_infosr      s/   ,.J&&((  |$$$.5
4 +4 +++w/J/J/L/LL+++4 (//===4 +++w>++++   &#G$?$?$A$ABB ..#GO44	$ $
4    % s   A4B!!AC;:C;strc                x   t          dd          }|dz  }|                                 D ]}|j        t          k    r}|j        rv|                                D ]a\  }}|d}n|                                 d}|t          |d          z  }t          |t                    sJ |t          d|           dz  }b|S )	z'Get documentation for the main checker.z"Pylint global options and switches-z/
Pylint provides global options and switches.

NzGeneral optionsz options~
)
r	   r   r   r   r   _options_by_section
capitalize
isinstancer   r   )r   resultr   sectionr   titles         r   !_get_global_options_documentationr(   (   s    ?EEF
  F &&(( 	@ 	@<,,,,$+$?$?$A$A @ @ ?-EE&1133===E-s333!'400000_T7;;????M    Tshow_optionsboolc                    |rt          |           }nd}|t          dd          z  }|dz  }t          |           }t          |          D ])}||         }|d         }|d= | |j        di |d|iz  }*|S )z*Get documentation for individual checkers. z%Pylint checkers' options and switchesr   z
Pylint checkers can provide three set of features:

* options that control their execution,
* messages that they can raise,
* reports that they can generate.

Below is a list of all checkers and their features.

r   r*    )r(   r	   r   sortedget_full_documentation)r   r*   r%   r   checker_nameinformationr   s          r   _get_checkers_documentationr3   <   s     26::
mCSIIIF
 
 
F %V,,Jz** 
 
 .i(	"0'0 
 

 
(4
 
 
 	
 Mr)   streamr   Nonec                V    t          t          | |          dd         |           dS )z+Output a full documentation in ReST format.)r*   N)file)printr3   )r   r4   r*   s      r   print_full_documentationr:   Z   sA     
#FFFFssKRX     r)   )r   r
   r   r   )r   r
   r   r   )T)r   r
   r*   r+   r   r   )r   r
   r4   r   r*   r+   r   r5   )__doc__
__future__r   systypingr   r   r   pylint.constantsr   pylint.utils.utilsr   r	   pylint.lint.pylinterr
   r   r(   r3   stdoutr:   r.   r)   r   <module>rC      s   
 F E " " " " " " 



 - - - - - - - - - - . . . . . . = = = = = = = = .------   *   (    > (+z      r)   