bgddlZddlZddlZddlZddlmZddlmZddlm Z ddl m Z m Z m Z ddlmZddlmZddlmZdd lmZdd lmZdd lmZmZdd lmZmZdd lmZddl m!Z!GddZ"dZ#dZ$e%dkr e$dSdS)N)datetimePath)TextIO)blender postfiltertools)is_relative_to)ProspectorConfig) configuration)FatalProspectorException) FileFinder) FORMATTERS Formatter)LocationMessage)DEPRECATED_TOOL_NAMES) CaptureOutputcHeZdZdefdZdZdZdZdZdZ de d e fd Z d S) Prospectorconfigc:||_d|_|j|_dSN)rsummarymessages)selfrs _/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/prospector/run.py__init__zProspector.__init__s   cN|jjrtj|}|jjr`g}dt jD}|D]<}||j|j|_| |=|}tj |j |S)Nci|]\}}|| Sr").0kvs r z/Prospector.process_messages..!sHHH$!QAHHHr) rblendingrblendlegacy_tool_namesritemsgetsourceappendrfilter_messagespython_modules)r found_filesrupdated new_namesmsgs rprocess_messageszProspector.process_messagess ;  /}X..H ; ( GHH*?*E*G*GHHHI $ $&]]3:szBB s####H)+*DhOOOrc |j}dtji}||jd|jjD}t|d|jgi}g}|D]{}t|jj dddd}t|}d|d|d|d} tdd || } | | tj| t ||j|D]+} t$jD]\} } | | jkr| }nd } t-|jj 5}|| |z }|jjrt|jj dddd}|r@d|d|} | t|d|| |r@d|d|} | t|d|| dddn #1swxYwYW#t8$rK}t:jtA|t;j!dYd}~d}~wtD$rv}|jj#rt9d|d|t|jj dddd}d|d} t|d|| } | | Yd}~%d}~wwxYw|$||}tK||d<tj|d<|d|dz }d|&z|d<g}|jj'D]\} }|| | |ftK|dkr"d(d|D|d<||_)|j*|z|_*dS)Nstartedc,g|]}t|Sr"r)r#ps r z&Prospector.execute..1s444Qa444rexclusion_filterszTool z has been renamed to z. The old name zf is now deprecated and will be removed in Prospector 2.0. Please update your prospector configuration. prospector Deprecation)message)categoryUnknown)hidez stderr from z: z hidden-outputz stdout from z failed to run.zV failed to run (exception was raised, re-run prospector with -X to see the stacktrace)failure message_count completedz%0.2f time_takenrz, cg|]}d|zS)z%s: %sr")r#infos rr9z&Prospector.execute..s3`3`3`HtO3`3`3`rexternal_config)+rreplace_deprecated_tool_namesrnowupdateget_summary_informationpathsrmake_exclusion_filterrworkdirrrr-warningswarnDeprecationWarning get_toolsr TOOLSr* __class__rdirect_tool_stdoutruninclude_tool_stdoutget_hidden_stderrget_hidden_stdoutr sysstderrwritestrexit Exceptiondie_on_tool_errorr4len total_seconds configured_byjoinrr)rdeprecated_namesrrMr0rdeprecated_namelocnew_namer3r=toolnameclstoolnamecapturefatalexdeltarHrds rexecutezProspector.execute)s<;DDFF x|~~  t{::<<===44$+"3444 %aDK<]<]<_<_;`aa  0 < W>W>Y>Y"["[C$OOGHos\_,`,`,`aaa"4466b"["["[g>W>W>Y>Y"["[C$OOGHos\_,`,`,`aaa b b b b b b b b b b b b b b b,      U,,,  ) ) );0^23T83T3T3TUU[]]t{2D$dKK_H___"  (((((((( ) ((h??#&x== '|~~  $wy'99 '%*=*=*?*? ? #';#<#B#B#D#D > > D-(&&m'<===   ! # #)-3`3`P_3`3`3`)a)aG% &  0 sK(JC*I9- J9I= =JI= J MAK M#A+MMc|jSr)rrs r get_summaryzProspector.get_summarys |rc|jSr)rrts r get_messageszProspector.get_messagess }rc$j}|D]}|\}}|jd<d}jjs1t fdjjDr jj}t|jjjj |}|s,jj s |tj |D]E}tj|d5} ||dddn #1swxYwYFdS)N formatterc3LK|]}t|jjVdSr)r rrO)r#r8rs r z,Prospector.print_messages..sC66;<q$+"566666666rzw+)rget_output_reportrabsolute_pathsallrMrOrrprofilequietwrite_tor[stdoutcodecsopen) routput_reportsreport output_format output_files relative_tory output_filetargets ` rprint_messageszProspector.print_messagessz6688$ 5 5F*0 'M<(5DL %K;- 2#6666@D @Q66633 2#k1 "=1$, t{ObdoppI 5 (9 5 i444+ 5 5 [d335vMM)V444555555555555555 5 5 5s DD D ryrc|||jj |jj |jj|ddS)N)rrr )r]renderr messages_only summary_only show_profile)rryrs rrzProspector.write_tosh    K55![55 0        TrN) __name__ __module__ __qualname__r rr4rrrurwrrrrr"rrrrs(/(((( P P P]1]1]1~555, ) V      rrctj}tjdd}||jdS)z This is a helper method to return an argparse parser, to be used with the Sphinx argparse plugin for documentation. r;N)prog description)cfg build_managerbuild_command_line_source build_parsersettings)managerr,s r get_parserrs@ !!G  * $ O O OF   w/ 6 66rct}|j}t|dkrltd|DsStjdtt j dt|}| | | rt j dt|dkrt j dt j ddS)Nc3TK|]#}tj|V$dSr)ospathisfile)r#rs rr{zmain..s0!I!I4"'.."6"6!I!I!I!I!I!IrzA In multi-path mode, all inputs must be files, not directories. rAr)r rMrbr~r[r\r]r print_usager_rrrrexit_with_zero_on_successrw)rrMr;s rmainrs    F LE 5zzA~~c!I!I5!I!I!III~ bccc   """  F##J ''))   : " " $ $%%))  HQKKKKKr__main__)&ros.pathrr[rPrpathlibrtypingrr;rrr prospector.compatr prospector.configr r rprospector.exceptionsr prospector.finderrprospector.formattersrrprospector.messagerrprospector.toolsrprospector.tools.utilsrrrrrr"rrrs  1111111111,,,,,,......222222::::::((((((7777777700000000222222000000XXXXXXXXv7778 zDFFFFFr