bg3 ddlmZ ddlZddlZdZn#e$r ddlZdZYnwxYwddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlmZddlmZmZddlmZmZmZmZmZmZmZmZmZddlmZm Z m!Z!dd l"m#Z#dd l$m%Z%e j&d krdd lm'Z'ndd l(m'Z'er dd l)m*Z*ddl+m,Z,dZ-e'dZ.e'dZ/e'dZ0e'dZ1e'dZ2e'dZ3ee.e/e0e1e2e3fZ4ede5e6ee7ee7eee7ee6dfZ8e-dfdwdZ9gd Z:dxd$Z;dyd'Z d|d}d4Z? d~dd<Z@dd?ZAddDZBe dddLZCe dddOZCe dddSZCe dddWZCe ddd[ZCe ddd_ZC d|ddcZCdddgZDddhZEddlZFddmZGddqZH d|ddsZIddtZJGdudvZKdS)) annotationsNTF)Sequence)BufferedReaderBytesIO) TYPE_CHECKINGAnyListPatternTextIOTupleTypeVarUnionoverload)Modulemodutilsnodes)PY_EXTS) OptionDict))Literal) BaseChecker)PyLinterO)zsuggestion-modezanalyse-fallback-blockszallow-global-unused-variables)zmax-line-lengthzdocstring-min-lengthzignored-modules)zno-docstring-rgxzdummy-variables-rgxzignored-argument-nameszmixin-class-rgx)zexclude-too-few-public-methodsz ignore-paths py-versionT_GlobalOptionReturnTypes.textstrline_lenintindentreturncXdtj||||S)z'Wrap the text on the given line length. )widthinitial_indentsubsequent_indent)jointextwrapwrap)rr r"s c/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/pylint/utils/utils.pynormalize_textr-Zs7 99 6     )=-+a int | floatbc||k||kz SN)r2r4s r,cmpr8is Ea!e r.oldnewctt||z }tt|||r|dpd}|S)zUGiven an old and new int value, return a string representing the difference. z.2fr)absCMPSr8)r9r:diffdiff_strs r, diff_stringr@msC sSy>>Ds3}}%Et'=4 'CEEH Or.node nodes.NodeNGtuple[str, str]cp|d}dg}}|rpt|tr|j}n$|t |dd |jd}n#t$rYnwxYw|p||d |fS)z6Return the module name and the frame id in the module.T)futurernamez.) frame isinstancerrFappendgetattrparentAttributeErrorreverser))rArHmoduleobjs r,get_module_and_frameidrQvs JJdJ # #EbCF  eV $ $ ;ZFF JJwufj99 : : : L&&d&33EE    E  KKMMM 388C==  sA;; BBtitle characterc2|d|t|zdS)zgPermit to get a title formatted as ReStructuredText test (underlined with a chosen character). r%)len)rRrSs r, get_rst_titlerVs& 1 1y3u::- 1 1 11r.section str | Noneoptions!list[tuple[str, OptionDict, Any]]doccd}|r|t|dz }|rt|}||dz }|D]\}}}|d}|d|dz }|r0t|tsJt|d} || d z }|r@|d kr:t t ||}|d |d d dz }|S)zHFormat an option's section using as a ReStructuredText formatted output.r'z help:z: z r"r%rz Default: ``z`` z```` ``z`` )rVr-getrIr_format_option_valuereplace) rWrYr[result formatted_docoptnameoptdictvaluehelp_optformatted_helps r,get_rst_sectionrks$ F.---- )&s++ ]((((#* N N%;;v&&"g""""  ,h,, , ,,+HTBBBN +++ +F  NW ,,,We<<==E M eY(G(GMMM MF Mr.strictstreamBufferedReader | BytesIOencodingerrorsLiteral['strict']codecs.StreamReaderc tj|ptj}n5#t$r(tjtj}YnwxYw|||Sr6)codecs getreadersysgetdefaultencoding LookupError)rmrorp reader_clss r,decoding_streamrzsv @%h&J#2H2J2JKK @@@%c&<&>&>?? @ :ff % %%s'*/AA nodes.Modulelist[tokenize.TokenInfo]c|5}|j}ttj|cdddS#1swxYwYdSr6)rmreadlinelisttokenize)rArmr~s r,tokenize_modulers 1&?H%h//00111111111111111111s(A  AAlinterr directoryNoneci}tj|D]5}tj|\}}||vs|dkr0|tvr|dksT|stjtj||r|ds tj tj||}t|dr| |d||<#t$rYt$r,}td|d|tjYd }~-d }~wwxYw7d S) zLoad all module and package in the given directory, looking for a 'register' function in each one, used to register pylint checkers. __pycache____init__rGregisterzProblem importing module z: fileN)oslistdirpathsplitextrisdirr) startswithrload_module_from_filehasattrr ValueError ImportErrorprintrvstderr)rrimportedfilenamebase extensionrOexcs r,register_pluginsrsHJy))'''**844i 8  t}44    ""#GMM"',,y$"?"?@@#!++C00 # '!7GLLH556:..'OOF+++%&HTN    V V VC(CCcCC#*UUUUUUUUU V)''s+2D E  E !EE checkerroptionGLOBAL_OPTION_BOOLdefault bool | NoneboolcdSr6r7rrrs r,get_global_optionr Cr.GLOBAL_OPTION_INT int | NonecdSr6r7rs r,rrrr.GLOBAL_OPTION_LISTlist[str] | None list[str]cdSr6r7rs r,rr Cr.GLOBAL_OPTION_PATTERNPattern[str] | None Pattern[str]cdSr6r7rs r,rrrr.GLOBAL_OPTION_PATTERN_LISTlist[Pattern[str]] | Nonelist[Pattern[str]]cdSr6r7rs r,rrrr.GLOBAL_OPTION_TUPLE_INTtuple[int, ...] | Nonetuple[int, ...]cdSr6r7rs r,rrrr.GLOBAL_OPTION_NAMES T_GlobalOptionReturnTypes | None&T_GlobalOptionReturnTypes | None | Anyctjdtdt|jj|ddS)aDEPRECATED: Retrieve an option defined by the given *checker* or by all known option providers. It will look in the list of all options providers until the given *option* will be found. If the option wasn't found, the *default* value will be returned. zkget_global_option has been deprecated. You can use checker.linter.config to get all global options instead. stacklevelr0_)warningswarnDeprecationWarningrKrconfigrcrs r,rr sN M C  7>(&..c*B*B C CCr.,stringsepc@d||DS)a&Return a list of stripped string by splitting the string given as argument on `sep` (',' by default), empty strings are discarded. >>> _splitstrip('a, b, c , 4,,') ['a', 'b', 'c', '4'] >>> _splitstrip('a') ['a'] >>> _splitstrip('a, b, c,') ['a', 'b', 'c'] :type string: str or unicode :param string: a csv line :type sep: str or unicode :param sep: field separator, default to the comma (',') :rtype: str or unicode :return: the unquoted string (or the input string if it wasn't quoted) c^g|]*}||+Sr7strip).0words r, z_splitstrip..5s- G G GT$**,, GDJJLL G G Gr.)split)rrs r, _splitstripr!s%( H GV\\#%6%6 G G GGr.c^|s|S|ddvr |dd}|ddvr |dd}|S)zRemove optional quotes (simple or double) from the string. :param string: an optionally quoted string :return: the unquoted string (or the input string if it wasn't quoted) rz"'rNr7)rs r,_unquoter8sN   ayE bzU Mr.rhlist[str] | tuple[str] | str Sequence[str]c\t|ttfr|St|Sr6)rIrtupler)rhs r, _check_csvrGs+%$'' u  r.cxd|D}d}d|d|zS)zReturn string as a comment.c6g|]}|Sr7r)rlines r,rz_comment..Os : : :dTZZ\\ : : :r.r%# ) splitlinesr))rlinesrs r,_commentrMsC : :f&7&7&9&9 : : :E C S***//%(( ((r.rgrrcndddkr dd|D}nt|ttfr"dfd|D}nt|t r2dd|D}ngt|d r|j}nOdd kr|rd nd }n/t|tr| rd |d }t|S)zfReturn the user input's value from a 'compiled' value. TODO: 3.0: Remove deprecated function typeN py_versionrGc34K|]}t|VdSr6)r)ritems r, z'_format_option_value..Zs(55tT555555r.rc38K|]}t|VdSr6)rb)rrrgs r,rz'_format_option_value..\s.OO-gt<<OOOOOOr.c3*K|]\}}|d|VdS)r_Nr7)rkvs r,rz'_format_option_value..^s0>>1A>>>>>>r.matchynyesnor]) rar)rIrrdictitemsrpatternrisspace)rgrhs` r,rbrbTs6 {{64  L0055u55555 ED%= ) ) OOOOOOOOO E4 >> >>>>>    V   $ $(D E3  EMMOOE  u::r.r cVtjdtd|rtt ||td|d|tj5tjdtt||d d d d S#1swxYwYd S) z0Format an option's section using the INI format.zEformat_section has been deprecated. It will be removed in pylint 3.0.rrr[]ignore)categoryN)rrrrrcatch_warningsfilterwarnings _ini_format)rmrWrYr[s r,format_sectionris MO  * hsmm&)))) .g...v&&&&  " "%%3EFFFFFG$$$%%%%%%%%%%%%%%%%%%s%,BB"%B"cPtjdtd|D]\}}}d|vr(t|dtsJd|dvr3t ||}|d}|rJt|tsJt|d}t| t|| nt| |d vrtd |d | t| }tj d t|r^ddt|zz}|dt|dD}|dd}t|d || dS)z$Format options using the INI format.zB_ini_format has been deprecated. It will be removed in pylint 3.0.rrkwargs new_namesr^rr`r>rFalse#r/z^([\w-]+,)+[\w-]+$z  c3 K|] }|dzV dS)rNr7)rxs r,rz_ini_format..s&&N&N1q3w&N&N&N&N&N&Nr.rNr)rrrrIrrbrarr-rrrerrUr)r)rmrYrfrgrhri separators r,rr}s ML $+55% w  gh/66 6 66gh///$We44;;v&&  h,, , ,,%ht<<r/s~ #"""""KKLLLKKK  $$$$$$&&&&&&&&                      ,+++++++++$$$$$$$$$$$$v))))))%888888$$$$$$% EF./ %%UV!,/ $GI CL #s(O 3"!!!!"22228!) & & & & &1111 ''''B MP   KN   !$  $'  *-  '* 15DDDDD*HHHHH.     ))))2 %%%%%(5555D5555555555s  !!