
    c                        d Z ddlmZ ddl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 ]v}|j        }|t          k    r`	 |||         d<   t          j                    5  t          j        dt                     ||         dxx         |                                z  cc<   ddd           n# 1 swxY w Y   ||         d                             |j	                   ||         dxx         |j
        z  cc<   # t          $ r t          j                    5  t          j        dt                     |t          |                                          t          |j	                  t          |j
                  d||<   ddd           n# 1 swxY w Y   Y rw xY wx|S )	z,Get info from a checker and handle KeyError.checkerignorecategoryoptionsNmsgsreports)r   r   r   r   )get_checkersnamer   warningscatch_warningsfilterwarningsDeprecationWarningoptions_and_valuesupdater   r   KeyErrorlistdict)r   
by_checkerr   r   s       1lib/python3.11/site-packages/pylint/utils/docs.py_get_checkers_infosr#      s6   ,.J&&((  |$$ 	.5
4 +,.. P P+H?QRRRRt$Y///73M3M3O3OO///P P P P P P P P P P P P P P P 4 (//===4 +++w>++++   ,..  +H?QRRRR#*#'(B(B(D(D#E#E $W\ 2 2#'#8#8	( (Jt$              	" s\   C)ABC)B 	 C)#B 	$AC))F
A)E;/F
;E??F
E?F
	F
strc                   t          dd          }|dz  }|                                 D ]}|j        t          k    r|j        rt          j                    5  t          j        dt                     |	                                D ]a\  }}|d}n|
                                 d}|t          |d	          z  }t          |t                    sJ |t          d|           d
z  }b	 ddd           n# 1 swxY w Y   |S )z'Get documentation for the main checker.z"Pylint global options and switches-z/
Pylint provides global options and switches.

r   r   NzGeneral optionsz options~
)r	   r   r   r   r   r   r   r   r   options_by_section
capitalize
isinstancer   r   )r   resultr   sectionr   titles         r"   !_get_global_options_documentationr/   -   s   ?EEF
  F &&(( D D<,, 
	D 
	D(** 	D 	D';MNNNN(/(B(B(D(D D D$GW B 1#*#5#5#7#7 A A AmE3777F%gt44444w!?!?CCCCFFD	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D Ms   BC55C9	<C9	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   r0    )r/   r	   r#   sortedget_full_documentation)r   r0   r,   r!   checker_nameinformationr   s          r"   _get_checkers_documentationr9   C   s     26::
mCSIIIF
 
 
F %V,,Jz** 
 
 .i(	"0'0 
 

 
(4
 
 
 	
 M    streamr   Nonec                V    t          t          | |          dd         |           dS )z+Output a full documentation in ReST format.)r0   N)file)printr9   )r   r;   r0   s      r"   print_full_documentationrA   a   sA     
#FFFFssKRX     r:   )r   r
   r   r   )r   r
   r   r$   )T)r   r
   r0   r1   r   r$   )r   r
   r;   r   r0   r1   r   r<   )__doc__
__future__r   sysr   typingr   r   r   pylint.constantsr   pylint.utils.utilsr   r	   pylint.lint.pylinterr
   r#   r/   r9   stdoutrA   r4   r:   r"   <module>rJ      s  
 F E " " " " " " 



  - - - - - - - - - - . . . . . . = = = = = = = = .------   2   ,    > (+z      r:   