bgdZddlmZddlZddlZddlmZmZmZddl m Z ddl m Z m Z erddlmZdd ZddZdddZejdfddZdS)z?Various helper functions to create the docs of a linter object.) annotationsN) TYPE_CHECKINGAnyTextIO)MAIN_CHECKER_NAME)get_rst_section get_rst_title)PyLinterlinterr returndict[str, dict[str, Any]]c "i}|D]v}|j}|tkr` |||d<tj5tjdt ||dxx|z cc<dddn #1swxYwY||d|j ||dxx|j z cc<#t$rtj5tjdt |t|t|j t|j d||<dddn #1swxYwYYrwxYwx|S) z,Get info from a checker and handle KeyError.checkerignorecategoryoptionsNmsgsreports)rrrr) get_checkersnamerwarningscatch_warningsfilterwarningsDeprecationWarningoptions_and_valuesupdaterrKeyErrorlistdict)r by_checkerrrs b/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/pylint/utils/docs.py_get_checkers_infosr#s4,.J&&((| $ $ $ .5 4 +,..PP+H?QRRRRt$Y///73M3M3O3OO///PPPPPPPPPPPPPPP4 (// ===4 +++w>++++   ,..+H?QRRRR#*#'(B(B(D(D#E#E $W\ 2 2#'#8#8 ((Jt$  %" s\C) AB C)B C)#B $AC))F A)E;/ F ;E? ?F E? F  F strctdd}|dz }|D]}|jtkr|jrt j5t jdt| D]a\}}|d}n| d}|t|d z }t|tsJ|td|d z }b dddn #1swxYwY|S) z'Get documentation for the main checker.z"Pylint global options and switches-z/ Pylint provides global options and switches. rrNzGeneral optionsz options~ )r rrrrrrrroptions_by_section capitalize isinstancerr)r resultrsectionrtitles r"!_get_global_options_documentationr/-s ? E EF F&&(( D D <, , , ,(** D D';MNNNN(/(B(B(D(DDD$GW 1#*#5#5#7#7 A A AmE3777F%gt44444w!?!?CCCCFFD D D D D D D D D D D D D D D D MsBC55C9 <C9 T show_optionsboolc|rt|}nd}|tddz }|dz }t|}t|D])}||}|d}|d=||jdi|d|iz }*|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. rr0)r/r r#sortedget_full_documentation)r r0r,r! checker_name informationrs r"_get_checkers_documentationr9Cs26:: mCSIIIF  F%V,,Jz**   . i(  "0'0    (4     MstreamrNonecVtt||dd|dS)z+Output a full documentation in ReST format.)r0N)file)printr9)r r;r0s r"print_full_documentationrAasA #FFFFssKRXr:)r r r r )r r r r$)T)r r r0r1r r$)r r r;rr0r1r r<)__doc__ __future__rsysrtypingrrrpylint.constantsrpylint.utils.utilsrr pylint.lint.pylinterr r#r/r9stdoutrAr4r:r"rJs FE"""""" ----------......========.------2,>(+zr: