bg* DdZddlmZddlZddlZddlZddlZddlmZm Z ddl m Z m Z m Z mZmZmZmZddlmZddlmZddlmZdd lmZe r dd lmZdd lmZGd d e Ze eefZ gdZ!dZ"dZ#dZ$ddddddddZ%dddddddd d!d" Z&d#e eDZ' dEd'Z(e dFdGd+Z)e dHd(d,dId0Z) dJdKd4Z)dLd6Z*Gd7d8eZ+Gd9d:e+Z,Gd;de-Z.Gd?d@e+Z/dMdDZ0dS)NzwPlain text reporters:. :text: the default one grouping messages by module :colorized: an ANSI colorized text reporter ) annotationsN)asdictfields) TYPE_CHECKINGDict NamedTupleOptionalTextIOcastoverload)Message) BaseReporter) TextWriter) _splitstrip)PyLinter)Sectionc.eZdZUdZded< dZded<dS) MessageStylezStyling of a message. str | Nonecolorztuple[str, ...]styleN)__name__ __module__ __qualname____doc____annotations__rrf/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/pylint/reporters/text.pyrrs< EJJrr)=-.z[mz0134579)resetbolditalic underlineblinkinversestrike3031323334353637) r,blackredgreenyellowbluemagentacyanwhitech|] }|j Sr)name).0is r rGEs222Q!&222r msg_stylereturnstrcdd|jD}|jrp|jr2|ddg||jn%|t |j|r%t d|ztzSdS)zReturn ANSI escape code corresponding to color and style. :param msg_style: the message style :raise KeyError: if a nonexistent color or style identifier is given :return: the built escape code c(g|]}t|Sr) ANSI_STYLES)rEeffects r z"_get_ansi_code..RsCCCV$CCCr38r);r ) rrisdigitextendappend ANSI_COLORS ANSI_PREFIXjoinANSI_END)rH ansi_codes r_get_ansi_coderZIsDC9?CCCI; ? " " $ $ ;   dC[ ) ) )   Y_ - - - -   [9 : : :<SXXi0008;; 2r.msgMessageStyle | NonecdSNr)r[rHs r colorize_ansir_^s Cr)rrrrcdSr^r)r[rHrrs rr_r_fs Crr MessageStyle | str | Nonekwargsc lt|ts_tjdtd|d}t t|}t|p||}|jt|j dkr|St|}|r ||tS|S)acolorize message by wrapping it with ANSI escape codes :param msg: the message string to colorize :param msg_style: the message style or color (for backwards compatibility): the color of the message style :param style: the message's style elements, this will be deprecated :param \**kwargs: used to accept `color` parameter while it is being deprecated :return: the ANSI escaped string zeIn pylint 3.0, the colorize_ansi function of Text reporters will only accept a MessageStyle parameter stacklevelrNr) isinstancerwarningswarnDeprecationWarninggettuplerrlenrrZ ANSI_RESET)r[rHrrbr style_attrs escape_codes rr_r_rs( i . . B  %       7##K..//  !3)[AA 3y#7#71#<#<  ++K10s0J000 Jrr cd|jS)Nz************* Module )module)r[s r make_headerrss /3: / //rcReZdZdZdZdZdZddfd ZddZddZ ddZ ddZ xZ S) TextReporterz+Reports messages and layouts in plain text.texttxtz2{path}:{line}:{column}: {msg_id}: {msg} ({symbol})Noutput TextIO | NonerINonect|t|_|j|_|j|_dSr^)super__init__set_modules line_format _template_fixed_templateselfrx __class__s rr}zTextReporter.__init__sA    "%%% )#/QQrrrrJfilepathrcXt|jjjp|j}||jkrdS||_t jd|}|D]Q}|dtvr@tj d|ddt j d|dzdzd|}R||_ dS) zHSet the format template to be used and check for unrecognized arguments.Nz\{(\w+?)(:.*)?\}rzDon't recognize the argument 'zW' in the --msg-template. Are you sure it is supported on the current version of pylint?z\{z (:.*?)?\}r ) rJlinterconfig msg_templaterrefindallMESSAGE_FIELDSrhrisubr)rrrrtemplate argumentsarguments ron_set_current_modulez"TextReporter.on_set_current_modulest{)6H$.II t~ % % F"J2H== ! T TH{.00 UXa[UUU6%(1+"5 "Db(SS'rr[r ct|}dD]}||pd||<||jjdi|dS)z]Convenience method to write a formatted message with class default template. )end_line end_columnr Nr)rwritelnrformat)rr[ self_dictkeys r write_messagezTextReporter.write_messagesa3KK - 2 2C&s^1rIcNN 0T)0==9==>>>>>rc|j|jvrA|t||j|j||dS)z:: parseablez0{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}NrxryrIrzctj|jd|jtdt |dS)NzC output format is deprecated. This is equivalent to --msg-template=rdre)rhrirDrrjr|r}rs rr}zParseableTextReporter.__init__sY y o o]a]m o o          rr^r)rrrrrDrr}rrs@rrrsX DDK!!!!!!!!!!!rrceZdZdZdZdZdS)VSTextReporterzVisual studio text reporter.msvsz/{path}({line}): [{msg_id}({symbol}){obj}] {msg}N)rrrrrDrrrrrrs&& DCKKKrrc eZdZUdZdZededdeddededdedd ed d d Zd ed< ddfd ZddZ d dZ xZ S)!ColorizedTextReporterz/Simple TextReporter that colorizes text output. colorizedr=N)r-r@)r-r.r<)r-r/r>)r1)ICRWEFSColorMappingDict COLOR_MAPPINGrxry color_mapping;ColorMappingDict | dict[str, tuple[str | None, str]] | NonerIrzct||rtt|dt sxt jdtdi}| D]B\}}|d}tt|d}t ||||<C|}n ttt|}|p tj|_ddg}t$jd|vr5t*jd kr'ddl} | |j|_dSdSdS) NrzeIn pylint 3.0, the ColorizedTextReporter will only accept ColorMappingDict as color_mapping parameterrdrez xterm-16colorzxterm-256colorTERMwin32)r|r}rglistvaluesrrhrirjitemsrlrr r rrrrosenvironrksysplatformcolorama AnsiToWin32r) rrxrtemp_color_mappingrvaluerro ansi_termsrrs rr}zColorizedTextReporter.__init__ sq      L %%'' ( ( +\" "  L M*"      46 +1133 K K Ua#Ka$9$9:: *6uk*J*J"3''.MM *:!;]KKM*Q.C.Q%'78 :>>& ! ! 3 3|w&&#//99 4 3&&rmsg_idrJrc`|j|dptdS)z;Returns the message style as defined in self.color_mapping.rN)rrkr)rrs r_get_decorationz%ColorizedTextReporter._get_decoration1s*!%%fQi00FL4F4FFrr[r c|j|jvrf|d}tt ||}|||j|j||j}t|j||_t|j ||_ t|j ||_ t|j||_| |dS)z`Manage message of different types, and colorize output using ANSI escape codes. rN) rrrrr_rsrrrr[symbolcategoryr)rr[rHmodseps rrz$ColorizedTextReporter.handle_message5s :T] * *,,S11I";s#3#3Y??F LL M  cj ) ) )((// 33"3:y99 $S\9== ceY// 3r)NN)rxryrrrIrz)rrJrIrr) rrrrrDrrrr}rrrrs@rrrs 99 D \' " " \$ * * \)%7 8 8 \) $ $ \% + + \%!6 7 7 \(L 1 1''M!%  ":":":":":":":HGGGG        rrrrrzc |t|t|t|t|t dSr^)register_reporterrurrrr)rs rregisterrGso \*** -... 2333 ^,,, 233333r)rHrrIrJ).)r[rJrHr\rIrJ)..) r[rJrHrrrJrrrIrJ)Nr ) r[rJrHrarrJrbrrIrJ)r[r rIrJ)rrrIrz)1r __future__rrrrrh dataclassesrrtypingrrrr r r r pylint.messager pylint.reportersr%pylint.reporters.ureports.text_writerr pylint.utilsr pylint.lintrpylint.reporters.ureports.nodesrrrJrTITLE_UNDERLINESrVrXrnrMrUrrZr_rsrurrrrrrrrrs  #""""" &&&&&&&&TTTTTTTTTTTTTTTTTT""""""))))))<<<<<<$$$$$$8$$$$$$777777KKKKK:KKK\)*&&&               32&&//222&* &)      ,0%%%%%P00008.8.8.8.8.<8.8.8.v      |    !!!!!L!!!&DDDDD*DDDE E E E E LE E E P444444r