WIq UddlmZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddlm Z ddl m Z mZmZddlmZddlmZddlmZddlmZdd lmZddlZdd lmZdd lmZmZmZm Z dd l!m"Z"dd l#m$Z$ddl%m&Z&m'Z'm(Z(m)Z)ddl*m+Z+ddl,m-Z-ddl.m/Z/m0Z0ddl1m2Z2m3Z3m4Z4ddl5m6Z6ddl7m8Z8ddl9m:Z:m;Z;mZ>m?Z?m@Z@mAZAddlBmCZCmDZDmEZEddlFmGZGddlHmIZIdd lJmZKddlLmMZMmNZNmOZOmPZPmQZQmRZRmSZSddlTmUZUmVZVmWZWmXZXejYdkrddlmZZZnddl[mZZZej\Z\GddeZZ]dvd"Z^dwd%Z_id&d'd(d)d*e)j`ifd+d,d-d.d*e)j`ifd/d0d1d2d*e)j`ifd3d4d5d6d*e)j`ifd7d8d9d:d*e)j`ifd;dd*e)j`ifd?d@dAdBd*e)j`ifdCdDdEdFd*e)j`ifdGdHdIdJd*e)j`ifdKdLdMdNd*e)j`ifdOdPdQdRdSge)j`dTfdUd'dVdWd*e)j`ifdXdYdZd[d*e)j`ifd\d]d^d_e)j`d`gdafdbdcdddee)j`d`gdafdfdgdhdid*e)j`ifdjdkdldmd*e)j`ifdndodpdqd*e)j`ifiZadrebds<Gdtdue$e6e jcej"ZddS)x) annotationsN) defaultdict)CallableIteratorSequence) TextIOWrapper)Path)Pattern) ModuleType)Any)nodes)checkers exceptions interfaces reporters) BaseChecker)_ArgumentsManager)MAIN_CHECKER_NAME MSG_TYPESMSG_TYPES_STATUS WarningScope)HIGH)_make_linter_options) load_results save_results)_is_ignored_filediscover_package_pathexpand_modules)_MessageStateHandler)check_parallel)report_messages_by_module_statsreport_messages_statsreport_total_messages_stats)_is_relative_toaugmented_sys_pathget_fatal_error_messageprepare_crash_report)MessageMessageDefinitionMessageDefinitionStore) BaseReporter) TextReporter)DirectoryNamespaceDictFileItemManagedMessageMessageDefinitionTupleMessageLocationTupleModuleDescriptionDictOptions) ASTWalker FileState LinterStatsutils))ProtocolceZdZ d d d ZdS) GetAstProtocolNfilepathstrmodnamedata str | Nonereturn nodes.ModulecdSN)selfr=r?r@s /srv/buildsys-work-dir/castor/build_node/builder-2/WGSG1/unpkd_srcs/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/pylint/lint/pylinter.py__call__zGetAstProtocol.__call__Rs  rE)r=r>r?r>r@rArBrC)__name__ __module__ __qualname__rIrFrJrHr<r<Qs0>B       rJr<rBr>cttjtsJttjdt_tjS)Nutf-8encoding) isinstancesysstdinrdetachreadrFrJrH _read_stdinrWXsN ci / /// /ci..007CCCCI 9>>  rJreporter_classtype[BaseReporter]c |}tj|}tj|}|dd}t ||}t |ts J|d|S)N.z is not a BaseReporter)astroidmodutilsget_module_partload_module_from_namesplitgetattr issubclassr+)rXqname module_partmodule class_nameklasss rH_load_reporter_by_classri_s E"22599K   3 3K @ @FS!!"%J FJ ' 'E e\ * *LLu,L,L,LLL * LrJF0001z%sfatalzoUsed when an error occurred preventing the analysis of a module (unable to find it for instance).scopeF0002z%s: %s astroid-errorzUsed when an unexpected error occurred while building the Astroid representation. This is usually accompanied by a traceback. Please report such errors !F0010zerror while code parsing: %s parse-errorzlUsed when an exception occurred while building the Astroid representation which could be handled by astroid.F0011z)error while parsing the configuration: %szconfig-parse-errorzJUsed when an exception occurred while parsing a pylint configuration file.I0001z0Unable to run raw checkers on built-in module %sraw-checker-failedzRUsed to inform that a built-in module has not been checked using the raw checkers.I0010z#Unable to consider inline option %rzbad-inline-optionzUUsed when an inline option is either badly formatted or can't be used inside modules.I0011zLocally disabling %s (%s)zlocally-disabledzEUsed when an inline option disables a message or a messages category.I0013zIgnoring entire filez file-ignoredz0Used to inform that the file will not be checkedI0020zSuppressed %s (from line %d)zsuppressed-messagezA message was triggered on a line, but suppressed explicitly by a disable= comment in the file. This message is not generated for messages that are ignored due to configuration settings.I0021zUseless suppression of %szuseless-suppressionzbReported when a message is explicitly disabled for a line or a block of code, but never triggered.I0022z+Pragma "%s" is deprecated, use "%s" insteadzdeprecated-pragmazSome inline pylint options have been renamed or reworked, only the most recent form should be used. NOTE:skip-all is only available with pylint >= 0.26)I0014zdeprecated-disable-all) old_namesrlE0001 syntax-errorz0Used when a syntax error is raised for a module.E0011zUnrecognized file option %rzunrecognized-inline-optionz2Used when an unknown inline option is encountered.W0012zKUnknown option value for '%s', expected a valid pylint message and got '%s'zunknown-option-valuez8Used when an unknown value is encountered for an option.)E0012zbad-option-value)rlr{R0022z!Useless option value for '%s', %szuseless-option-valuezOUsed when a value for an option that is now deleted from pylint is encountered.E0013z;Plugin '%s' is impossible to load, is it installed ? ('%s')bad-plugin-valuez0Used when a bad value is used in 'load-plugins'.E0014zOOut-of-place setting encountered in top level configuration-section '%s' : '%s'zbad-configuration-sectionz_Used when we detect a setting in the top level of a toml configuration that shouldn't be there.E0015zUnrecognized option found: %szunrecognized-optionz7Used when we detect an option that we do not recognize.z!dict[str, MessageDefinitionTuple]MSGSc$eZdZUdZeZeZdZde d<dddZ dddZ e ddZ e jddZ ddZddZddZddZdd!Zdd#Zdd&Zdd(Zdd+Zdd,Zdd.Zdd/Zdd0Zdd1Zdd2Zdd3Zeddd8Z dd9Z!dd=Z"dd?Z#ddDZ$ddGZ%ddJZ&ddNZ'ddQZ(ddTZ)ddUZ*ddVZ+ddXZ, dddYZ-dd^Z.e/j0dd`Z1 dddbZ2ddkZ3ddmZ4ddnZ5ddpZ6ddqZ7dd}Z8 dddZ9d e:j;fddZcrash_file_path%Options controlling analysis messages2Options related to output formatting and reporting)Messages controlReportsrFNoptionsr3reporter7reporters.BaseReporter | reporters.MultiReporter | None option_groupstuple[tuple[str, str], ...]pylintrcrArBNonectj|dtj||||r||n!|t i|_ t jt|_ i|_ t|_ |t|z|_|D]}|d|j|d<|dz|_g|_ d|_t&j|t*j||ddt.fd d t0fd d t2ff|_t7|jj|_d|_g|_ tCd |jd|_"d|_#d|_$d|_%g|_&|'|dS)Npylint)progr))rr)rrFRP0001zMessages by categoryRP0002z% errors / warnings by moduleRP0003MessagesT)is_base_filestate)(r__init__r set_reporterr, _reporters collectionsrlist _checkers_dynamic_pluginsr6statsrroption_groups_descs_option_groupsfail_on_symbols _error_moderReportsHandlerMixInrrr#r!r"reportsr*config py_version msgs_store msg_status_by_id_managed_msgsr5 file_state current_name current_file _ignore_file _ignore_pathsregister_checker)rGrrrr opt_groups rHrzPyLinter.__init__s "4h7777%dD111 G  .   h ' ' ' '   lnn - - -CEC  #D ) )  ATV)!]] !(*>t*D*D D & B BI5>q\D $Yq\ 2 2;HL < +-T %..t444%%dD111-/J K//  z#8 9  11GHH9; $B4PPP(,(,!13 d#####rJcHtjdtd|jSNzQThe option_groups attribute has been deprecated and will be removed in pylint 3.0 stacklevelwarningswarnDeprecationWarningrrGs rHrzPyLinter.option_groups]s1  _     ""rJvaluecLtjdtd||_dSrr)rGrs rHrzPyLinter.option_groupsgs4 _     $rJcVtj|tj|dSrE)r initializerrs rHload_default_pluginszPyLinter.load_default_pluginsps*D!!!T"""""rJmodnames list[str]c|D]l}||jvr tj|}||||j|<L#t $r}||j|<Yd}~ed}~wwxYwdS)zCheck a list of pylint plugins modules, load and register them. If a module cannot be loaded, never try to load it again and instead store the error message for later use in ``load_plugin_configuration`` below. N)rr]r^r`registerModuleNotFoundError)rGrr?rfmnf_es rHload_plugin_moduleszPyLinter.load_plugin_modulests  7 7G$/// 7 )??HH%%%17%g..& 7 7 716%g...... 7 7 7s>A A- A((A-c>|jD]Z\}}t|tr|d||fd5t |dr||[d|jD|_dS)aCall the configuration hook for plugins. This walks through the list of plugins, grabs the "load_configuration" hook, if exposed, and calls it to allow plugins to configure specific settings. The result of attempting to load the plugin of the given name is stored in the dynamic plugins dictionary in ``load_plugin_modules`` above. ..note:: This function previously always tried to load modules again, which led to some confusion and silent failure conditions as described in GitHub issue #7264. Making it use the stored result is more efficient, and means that we avoid the ``init-hook`` problems from before. rr)argslineload_configurationcBi|]\}}|t|t SrF)rRr).0r?vals rH z6PyLinter.load_plugin_configuration..s<! ! !  C)<===! ! ! rJN)ritemsrRr add_messagehasattrr)rGr?module_or_errors rHload_plugin_configurationz"PyLinter.load_plugin_configurations )-(=(C(C(E(E 9 9 $G_/+>?? 9  &g-Ga!*>?? 9224888 ! ! $ 5 ; ; = =! ! ! rJreporter_namesc |jsdSg}g}tj5}|dD]}|dd^}}||}|||rG|t|ddd}||_||| j } dddn #1swxYwYt|dks|r*| tj|| dS| |ddS) z7Load the reporters if they are available on _reporters.N,:rrwrOrP)r contextlib ExitStackra_load_reporter_by_nameappend enter_contextopenoutpop_allcloselenrr MultiReporter) rGr sub_reporters output_filesstack reporter_namereporter_outputr output_fileclose_output_filess rH_load_reporterszPyLinter._load_reporterss  F   ! # # 7u!/!5!5c!:!: 5 5 2?2E2Ec12M2M/ 66}EE$$X..."5"'"5"5_Q/wGGG##K$/HL '' 444"'!6  7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 }   ! !\ !   '!&        mA. / / / / /sB=C**C.1C.rreporters.BaseReporterc|}||jvr|j|S t|}n4#ttt f$r}t j||d}~wwxYw|SrE)lowerrri ImportErrorAttributeErrorAssertionErrorrInvalidReporterError)rGrnamerXes rHrzPyLinter._load_reporter_by_names""$$ 4? " "(4?4(** * ?4]CCNN^^< ? ? ?1$77Q > ?~sAA5A00A50reporters.BaseReporter | reporters.MultiReporterc"||_||_dS)z6Set the reporter used to display messages and reports.N)rlinter)rGrs rHrzPyLinter.set_reporters! rJrXtype[reporters.BaseReporter]c$||j|j<dS)z7Registers a reporter class on the _reporters attribute.N)rr)rGrXs rHregister_reporterzPyLinter.register_reporters/=+,,,rJlist[BaseChecker]ct|jd} |||||n#t $rYnwxYw|S)Nc$t|ddS)Nrr)rb)xs rHz'PyLinter.report_order..sga6L6LrJ)key)sorted_reportspopindexr ValueError)rGrs rH report_orderzPyLinter.report_orders,L,LMMM ! KK d++ , , , NN4     D s(A A$#A$checkercheckers.BaseCheckerc|j|j||jD]\}}}|||||t |drE|j||jD]#}|j s| |j $t|dds| |jdSdS)z'This method auto registers the checker.msgsenabledTN) rrrrregister_reportrrregister_messages_from_checkermessagesdefault_enableddisablemsgidrb)rGrr_idr_titler_cbmessages rHrzPyLinter.register_checkers w|$++G444#*? ? ? D'4  wg > > > > 7F # # 0 O : :7 C C C"+ 0 0.0LL///w 400 ' LL & & & & & ' 'rJc|jj}|sdSt}t}|D]6}|tvr||!||7|jD]}|D]}|jD]|}|j|vs |j |vr:| |j|j |j N|jd|vr|j |j }dS)zEnable 'fail on' msgs. Convert values in config.fail_on (which might be msg category, msg id, or symbol) to specific msgs, then enable and flag them for later. Nr) rfail_onsetraddrvaluesrrsymbolenablerr)rG fail_on_vals fail_on_cats fail_on_msgsr all_checkersrmsgs rHenable_fail_on_messagesz PyLinter.enable_fail_on_messagessG {*   Fuu uu  & &Ci  %%%%  %%%%!N1133 @ @L' @ @"+@@CyL00CJ,4N4N CI...,33CJ????155,33CJ???@ @ @ @rJboolcrtfdjjDS)Nc3*K|] }|jvVdSrE)r)rrrGs rH z.PyLinter.any_fail_on_issues..s+OO1,,OOOOOOrJ)anyrby_msgkeysrs`rHany_fail_on_issueszPyLinter.any_fail_on_issuess7OOOOdj6G6L6L6N6NOOOOOOrJcz|jD] }|D]\}}}||!dS)zDisable all reporters.N)r r"disable_report)rGr report_id_s rHdisable_reporterszPyLinter.disable_reporterssZ-..00 / /J#- / / 1a##I.... / / /rJc|jsdS||d|dd|dd|dddS)zwParse the current state of the error mode. Error mode: enable only errors; no reports, no persistent. N miscellaneousrF persistentscore)rdisable_noerror_messagesr set_optionrs rH_parse_error_modezPyLinter._parse_error_mode sz   F %%''' _%%%  5)))  e,,, '''''rJcbtd|jDS)z1Return all available checkers as an ordered list.c3$K|] }|D]}|V dSrErF)rrcs rHr.z(PyLinter.get_checkers..2s/TTI)TTQaTTTTTTTrJ)r rr"rs rH get_checkerszPyLinter.get_checkers0s-TT)>)>)@)@TTTTTTrJcXtd|DS)z7Get all the checker names that this linter knows about.c<h|]}|jtk|jSrF)rr)rrs rH z-PyLinter.get_checker_names..7s2   <#444 444rJ)r rBrs rHget_checker_nameszPyLinter.get_checker_names4s<  #0022      rJc jjsg}ddD]L}fd|jD}|s t fd|jDr||M|S)z:Return checkers needed for activated messages and reports.rNc>h|]}||SrF)is_message_enabled)rr)rGs rHrEz,PyLinter.prepare_checkers..Es,TTTt7N7Ns7S7STTTTrJc3NK|]}|dV dS)rN)report_is_enabled)rrrGs rHr.z,PyLinter.prepare_checkers..Fs5UUt55ad;;UUUUUUrJ)rrr7rBrr/r)rGneeded_checkersrrs` rHprepare_checkerszPyLinter.prepare_checkers>s{" %  " " $ $ $.2V((**122. 0 0GTTTTw|TTTH 03UUUUW_UUUUU 0&&w///rJFr?path is_argumentc4|rdS|dS)aReturns whether a module should be checked. This implementation returns True for all python source file, indicating that all files should be linted. Subclasses may override this method to indicate that modules satisfying certain conditions should not be linted. :param str modname: The name of the module to be checked. :param str path: The full path to the source code of the module. :param bool is_argument: Whether the file is an argument to pylint or not. Files which respect this property are always checked, since the user requested it explicitly. :returns: True if the module should be checked. T.py)endswith)r?rOrPs rHshould_analyze_filezPyLinter.should_analyze_fileKs#"  4}}U###rJc|jj|_|jjD]0}||jjsd|j|j<1dS)zbInitialize linter for linting. This method is called before any linting is done. FN) r ignore_pathsrrrmay_be_emittedr _msgs_stater)rGr)s rHrzPyLinter.initializebs\ "[5?+ 4 4C%%dk&<== 4.3 + 4 4rJfiles_or_modules Sequence[str] Iterator[str]c#@K|D]}tj|rtjtj|dsg}tj|D]\}}t fd|Dr"t|jj |jj |jj r| hd|vr| Vfd|DEd{V|VdS)zDiscover python modules and packages in sub-directory. Returns iterator of paths to discovered modules and packages. z __init__.pyc3BK|]}|VdSrE) startswith)rsroots rHr.z+PyLinter._discover_files..ys/EE!4??1--EEEEEErJc3K|]9}|dtj|V:dS)rRN)rSosrOjoin)rfiler`s rHr.z+PyLinter._discover_files..sY$$ $#}}U33$GLLt44$$$$$$rJN) rbrOisdirisfilercwalkr/rrignoreignore_patternsrVr)rGrY something skip_subtreesr6filesr`s @rH_discover_fileszPyLinter._discover_filesns *  Iw}}Y''  Y 6611 ,. &(gi&8&8ND!UEEEE}EEEEE! ' * 3 0 ! &,,T222 $--%,,T222" $$$$(-$$$%0 ;  rJSequence[str] | strc`t|ttfst jdt d|f}jjr"t |}jj r't|dkrtj dtfd|D}jj sajjdkrQtjdd}t#jj|||t_dSt'|5jj r*|d}t+}n|}d}dddn #1swxYwYt'|55}||}||dddn #1swxYwYddddS#1swxYwYdS) zMain checking entry: check a list of files or modules from their name. files_or_modules is either a string or list of strings presenting modules to check. zNIn pylint 3.0, the checkers check function will only accept sequence of stringrrrz*Missing filename required for --from-stdincDh|]}t|jjSrF)rr source_roots)rfile_or_modulerGs rHrEz!PyLinter.check..s8   "&ndk6NOO   rJNr)rrRrtuplerrrr recursiverm from_stdinrrInvalidArgsErrorjobsrSrOr _iterate_file_descrsr%_get_file_descr_from_stdinrW_astroid_module_checker _get_asts _lint_files)rGrYextra_packages_pathsoriginal_sys_path fileitemsr@check_astroid_moduleast_per_fileitems` rHcheckzPyLinter.checksA *T5M:: 3 M`"     !12  ;  M$T%9%9:J%K%KLL  ; ! #$$)) 1@ $    &6     {% $+*:Q*>*> #    ))*:;;$     )CH F 4 5 5  {%  ;;>)T#B#B   !13GHHH  I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I IsI AF##F'*F'=H#-H ? H# H H#H H##H'*H'rIterator[FileItem]r@#dict[FileItem, nodes.Module | None]c~i}|D]}||j|j ||j|j|||<H#tj$r^}t ||j|j}t|j|}| d|j|ftYd}~d}~wwxYw|S)z$Get the AST for all given FileItems.rnr confidenceN) set_current_modulerr=get_astr]AstroidBuildingErrorr'rr&rr)rGrr@rfileitemex template_pathr)s rHr{zPyLinter._get_astssAC!  H  # #HM83D E E E -1\\%x}d.. **/    4)4+?!! .h.?OO  #"+S1#!  s$A  B:AB55B:rr=ctjdtd|t |||dS)NzkIn pylint 3.0, the checkers check_single_file function will be removed. Use check_single_file_item instead.rr)rrrcheck_single_file_itemr.)rGrr=r?s rHcheck_single_filezPyLinter.check_single_filesN  2      ##HT8W$E$EFFFFFrJrdr.c|5}||j||ddddS#1swxYwYdS)zCheck single file item. The arguments are the same that are documented in _check_files initialize() should be called before calling this method N)rz _check_filer)rGrdrs rHrzPyLinter.check_single_file_items ) ) + + G/C   T\+? F F F G G G G G G G G G G G G G G G G G Gs?AA ast_mappingr%Callable[[nodes.Module], bool | None]c|D]\}}| ||||!#t$r}t||j|j}t |j|}t|tj r%| d|j|ftn| d|tYd}~d}~wwxYwdS)z%Lint all AST modules from a mapping..Nrnrrk) r _lint_file Exceptionr'r=rr&rRr] AstroidErrorrr)rGrrrrfrrr)s rHr|zPyLinter._lint_filess !, 1 1 3 3 I I Hf~ I&2FGGGG I I I 4)4+?!! .h.?OOb'"677I$$'x/@#.FSW%$$W34$HHH I  I Is6 CB CCrfrCc||j|jd|_t |j|j||_|j|_ ||n#t$r}tj |d}~wwxYw|j |j}|D]\}}}|||d|dS)aLint a file using the passed utility function check_astroid_module). :param FileItem file: data about the file :param nodes.Module module: the ast module to lint :param Callable check_astroid_module: callable checking an AST taking the following arguments - ast: AST of the module :raises AstroidError: for any failures stemming from astroid FNrrr=rr5modpathrrrdrrr]r"iter_spurious_suppression_messagesr) rGrdrfrrspurious_messagesrrrs rHrzPyLinter._lint_files  4=999!#DL$/6JJ#K .  ( ( ( ( . . .&A - .!ONN O  "3 6 6 E4   UD$ 5 5 5 5 6 6s A!! A=+ A88A=rr<c||j|j||j|j}|dSd|_t |j|j||_|j|_ ||n#t$r}tj |d}~wwxYw|j |j}|D]\}}} |||d| dS)aMCheck a file using the passed utility functions (get_ast and check_astroid_module). :param callable get_ast: callable returning AST from defined file taking the following arguments - filepath: path to the file to check - name: Python module name :param callable check_astroid_module: callable checking an AST taking the following arguments - ast: AST of the module :param FileItem file: data about the file :raises AstroidError: for any failures stemming from astroid NFr) rGrrrdast_noderrrrrs rHrzPyLinter._check_file6s &  4=99974=$)44   F!#DL$/8LL%M .  * * * * . . .&A - .!ONN O  "3 6 6 E4   UD$ 5 5 5 5 6 6s/ A;; B BBc#Kt||jj|jj|jjrdS dt j|}nR#t$rEtj tj |d}YnwxYwt|||VdS)zReturn file description (tuple of module name, file path, base name) from given file path. This method is used for creating suitable file description for _check_files when the source is standard input. Nr[r)rrrhrirVrcr]r^modpath_from_filerrbrOsplitextbasenamer.)rGr=r?s rHryz#PyLinter._get_file_descr_from_stdin`s   K  K ' K $     F Fhhw/AA(KKLLGG F F Fg&&rw'7'7'A'ABB1EGGG Fw(3333333s2A))A B87B8c#K||D]K}|d|d|d}}}||||rt|||dVLdS)zReturn generator yielding file descriptions (tuples of module name, file path, base name). The returned generator yield one item for each Python module that should be linted. rrOisarg)rPrN) _expand_filesr"rTr.)rGrYdescrrr=is_args rHrxzPyLinter._iterate_file_descrsys''(899@@BB B BE%*6]E&M5>F(D''hF'KK BtXuZ/@AAAAA B BrJ dict[str, ModuleDescriptionDict]ct||jj|jj|jj|j\}}|D]}|dx}}|d}|||dkrGt|dtj tj zd}| |||S)z@Get modules and errors from a list of modules and handle errors.modrrkrrr) rrrqrhrirrr>replacerbgetcwdsepr)rGrYresulterrorserrorrr?rs rHrzPyLinter._expand_filess(  K $ K  K '      0 0E %e ,Gg,C  # #G , , ,g~~eDk**2229;;3GLL   Sw  / / / / rJc\|s|dS|j|pd||tjdtd||_|p||_|j|pd|r:| t||j }|r|p|j |_ dSdSdS)zZSet the name of the currently analyzed module and init statistics for it. NrzIn pylint 3.0 modname should be a string so that it can be used to correctly set the current_name attribute of the linter instance. If unknown it should be initialized as an empty string.rr)ron_set_current_modulerrrrrrinit_single_module_get_namespace_for_filer _directory_namespaces _base_configr)rGr?r= namespaces rHrzPyLinter.set_current_modules  8+ F ++GMr8DDD ? MN#    $$/ %%gm444  =44X :I ='<4+<  = = = =rJr namespacesr-argparse.Namespace | Nonec|D]F}t||r4||||d}|||dcSGdS)Nrr)r$r)rGr=r directoryrs rHrz PyLinter._get_namespace_for_filesm$ 4 4Ix33 4 88j3A6 $%i03333trJ/Iterator[Callable[[nodes.Module], bool | None]]c#Kt|}|}d|D}|D]}tj5tjdt t j|t jr7||vr3||ur/| |tj dt dddn #1swxYwYd|D}|D]}tj5tjdt t j|t j r3||vr/| |tj dt dddn #1swxYwY|D]+}| | |,tj|j|||V|j|j_t)|D]}|dS) z}Context manager for checking ASTs. The value in the context is callable accepting AST as its only argument. cFg|]}t|tj|SrF)rRrBaseTokenCheckerrrAs rH z4PyLinter._astroid_module_checker..s:   Jq(2K$L$L    rJrh)categoryzCheckers should subclass BaseTokenChecker instead of using the __implements__ mechanism. Use of __implements__ will no longer be supported in pylint 3.0NcFg|]}t|tj|SrF)rRrBaseRawFileCheckerrs rHrz4PyLinter._astroid_module_checker..s:   Jq(2M$N$N    rJzCheckers should subclass BaseRawFileChecker instead of using the __implements__ mechanism. Use of __implements__ will no longer be supported in pylint 3.0)walker tokencheckers rawcheckers)r4rNrcatch_warningsfilterwarningsrr implements ITokenCheckerrr IRawCheckerr add_checker functoolspartialr nbstatementsr statementreversedr)rGrrrrArrs rHrzz PyLinter._astroid_module_checkers4))++         A(**  ';MNNNN)!Z-EFF .. !((+++MD+                        A(**  ';MNNNN)!Z-CDD ,,&&q)))MD+                ! ( (G LLNNN   w ' ' ' '  %'#        &2  **  G MMOOOO  s& A2CC C 6A.E00E4 7E4 nodes.Module | Nonec f |t||dStjt|||S#tj$r`}t|jdd}|d}| d|t|jddd|jd t Yd}~nmd}~wtj $r!}| d | Yd}~n?d}~wt$r/}tjtj d ||d}~wwxYwdS)aReturn an ast(roid) representation of a module or a string. :param filepath: path to checked file. :param str modname: The name of the module to be checked. :param str data: optional contents of the checked file. :returns: the AST :rtype: astroid.nodes.Module :raises AstroidBuildingError: Whenever we encounter an unexpected exception NT)sourcelinenorr}offsetzParsing failed: '')r col_offsetrrrprzMBuilding error when trying to create ast representation of module '{modname}')r?)MANAGER ast_from_filer]builderAstroidBuilder string_buildAstroidSyntaxErrorrbrrrrr traceback print_exc)rGr=r?r@rrs rHrzPyLinter.get_asts |,,Xwt,LLL?11'::GGgx )   28Xt44D|   "28Xt<<4444         + 5 5 5   ]  4 4 4 4 4 4 4 4      ! ! !._   ts5A8AD.)ACD.C22 D.?*D))D.rrr4r!list[checkers.BaseRawFileChecker]rlist[checkers.BaseTokenChecker] bool | Nonec|j}|||||}|jsJ|j|z |jj|jd<|S)zlCheck a module from its astroid representation. For return value see _check_astroid_module r)r_check_astroid_modulerr by_module)rGrrrrbefore_check_statementsretvals rHrzPyLinter.check_astroid_module0sh#)"5++ fk=         "9 9 T./ < rJnodec tj|}nQ#tj$r?}|d|jdd|jdYd}~dSd}~wwxYw|js|d|jnR|||j rdS|D]}| ||D]}||| |d S) aCheck given AST node with given walker and checkers. :param astroid.nodes.Module node: AST node of the module to check :param pylint.utils.ast_walker.ASTWalker walker: AST walker :param list rawcheckers: List of token checkers to use :param list tokencheckers: List of raw checkers to use :returns: True if the module was checked, False if ignored, None if the module contents could not be parsed r}rr)rrNrsrFT) r7tokenize_moduletokenize TokenErrorrr pure_pythonrprocess_tokensrprocess_modulerg) rGrrrrtokensr raw_checker token_checkers rHrzPyLinter._check_astroid_moduleJs(" *400FF"      ^"'!*Q-bgaj  Q Q Q44444  5   1  B B B B    ' ' '  u* 1 1 **40000!. 5 5 ,,V4444 DtsA%4A  A%crt|_|jjt_|jjt_tj |jj |jj r)tj |jj |j dS)zInitialize counters.N) r6rrunsafe_load_any_extensionralways_load_extensionslimit_inference_resultsmax_inferable_valuesextension_package_whitelistupdateextension_pkg_allow_listextension_pkg_whitelistreset_message_countrs rHrz PyLinter.openrs ]] )-)N&'+{'J$+224;3WXXX ; .   / 6 6 3    &&(((((rJ int | Nonec|jtj|jjs|jjt|jj}|j|j ||j j r| |j |}ntj}|j j r|j ||}|j jrt!|j |jjn.|j|j t#d}|S)zClose the whole package /module, it's time to make reports ! if persistent run, pickle results for later comparison N)rdisplay_messages report_nodesSectionr_is_base_filestate base_nameron_closerrr make_reportsdisplay_reports_report_evaluationr:rr6)rGprevious_statssect score_values rHgenerate_reportszPyLinter.generate_reports~s" &&|';'='=>>>2 )5*$/*CDDN M " "4:~ > > >{" .((^DD#+--{" 4 --d3331133K{% DTZ)BCCC M " "4:{}} = = =KrJcdd}|jjJt|jj}|jjdkr|S|jj} |jj|jj|jj |jj |jj |jj|jj d}t|i|}||j_d|dd}|r|j}||d|dd||z d d z }n#t$r}d |}Yd}~nd}~wwxYw|jjr.t#j|}|j||S) z"Make the global evaluation report.Nr)rkrwarningrefactor conventionrinfozYour code has been rated at z.2fz/10z (previous run: z/10, z+.2f)z$An exception occurred while rating: )rrrrrr evaluationrkrrrrreval global_noterr;rEvaluationSectionrr ) rGnoter r stats_dictr)pnoterr s rHr zPyLinter._report_evaluationsz(444%do&?@@ : 1 $ $K[+  S)):- J/"j3!Z1 J B 33D&*DJ ">>>>>C S&2$ReRRRdUlRRRRRC > > >===CCCCCC > ;  01#66D M ) )$ / / / s A!C C3$C..C3message_definitionr)rnodes.NodeNG | Noner Any | Nonerinterfaces.Confidence | Noner end_linenoend_col_offsetc ||||rd|jr9|s |jj}|s |jj}|s |jj}|s |jj}n$|s|j}|s|j}|s|j}|s|j}||j||s=|j | |j|||j|dSt|jd} |xj t|jdzc_ |j| d|j|j| d |jj|jxxdz cc<n$#t*$rd|jj|j<YnwxYw|j} || |z} ||jd} } |j} n0t1j|\} } |j} | "| |jjdd}nd}|jtA|j|jtC| pd|| pd| |pd|pd||| |dS)zpAfter various checks have passed a single Message is passed to the reporter and added to stats. Nrrr configuration)"check_message_definitionpositionrrr!r" fromlinenorIrrhandle_ignored_message_get_message_state_scoperrrrincrease_single_message_count$increase_single_module_message_countrr0r#KeyErrorr)rr7get_module_and_frameidr`rdrrpath_strip_prefixhandle_messager(r1)rGrrrrrrr!r"msg_catr)rfobjabspathrOs rH_add_one_messagezPyLinter._add_one_messages 33D$???  9} 90=/D!:!%!9J!:!%!9J%B%)]%AN+?D!1!%J!1!%J%9%)%8N&&'9'?zRR  O 2 2--&,dJ#(     F.4Q78 +,>,DQ,GHH 00!<<< 77        = J 07 8 8 8A = 8 8 8 8 = = =;!>rJ)rFNrFN) rr3rrrrrrArBr)rBr)rrrBr)rBr)rrrBr)rr>rBr)rr>rBr)rrrBr)rXrrBr)rBr)rrrBr)rBr+)rBr)F)r?r>rOr>rPr+rBr+)rYrZrBr[)rYrnrBr)rrr@rArBr)rr>r=r>r?r>rBr)rdr.rBr)rrrrrBr)rdr.rfrCrrrBr)rr<rrrdr.rBr)r=r>rBr)rYrZrBr)rYrZrBrrE)r?rAr=rArBr)r=r rr-rBr)rBr)r=r>r?r>r@rArBr) rrCrr4rrrrrBr) rrCrr4rrrrrBr)rBr)rr)rrrrrrrr rrr!rr"rrBr)NNNNNNN)rr>rrrrrrrr rrr!rr"rrBr) rr>rr8rrrr rBr)>rKrLrM__doc__rrrrr__annotations__rrpropertyrsetterrrrrrrrrrr*r2r7r>rBrFrN staticmethodrTrrmrr{rrr|rrryrxrrrrcontextmanagerrzrrrrrr r3rrr5r:r=rFrJrHrrs  D D?O????DGLP57# G$G$G$G$G$R###X#$$$$####7777"    @0000@     >>>>     ' ' ' '@@@@>PPPP//// ( ( ( ( UUUU        $$$$\$, 4 4 4 4" " " " H<I<I<I<I|    4GGGGGGGGIIII. 6 6 6 6D(6(6(6(6T44442 B B B B*;?=====@    ====@?C(((((T4&&&&P ) ) ) )@%%%%N_ _ _ _ H $(37!%!%%)     L%)3=3G 2 ? ? ? ? ? ?rJr)rBr>)rXr>rBrY)e __future__rargparserrrrbrSrrrrcollections.abcrrriorpathlibr rer typesr typingr r]r rrrrrpylint.checkers.base_checkerrpylint.config.arguments_managerrpylint.constantsrrrrpylint.interfacesrpylint.lint.base_optionsrpylint.lint.cachingrrpylint.lint.expand_modulesrrr!pylint.lint.message_state_handlerrpylint.lint.parallelr pylint.lint.report_functionsr!r"r#pylint.lint.utilsr$r%r&r'pylint.messager(r)r*pylint.reporters.base_reporterr+pylint.reporters.textr,pylint.reporters.ureportsr pylint.typingr-r.r/r0r1r2r3 pylint.utilsr4r5r6r7 version_infor:typing_extensionsrr<rWriLINErr?rrrFrJrHr`sa #"""""" ######8888888888>>>>>>>>>>>>444444====== #"""""999999:::::::: CBBBBB//////  NMMMMMMMMM777777......;;;;;;BAAAAAAAAAAAv****** /     X   D+   8 ,#$ D+  1 ,#$ D+  & < ,#$ !D+. 3T ,#$ /D+: : " ,#$ ;D+H - " ,#$ ID+V #O ,#$ WD+b : ,#$ cD+n &  ,#$oD+@ # 0 ,#$ AD+N 5 >>>!&  OD+d  : ,#$ eD+p %$< ,#$ qD+| UB!&78  }D+N + "&78  OD+b E: ,#$ cD+n Y#  ,#$ oD+| 'A ,#$ }D+D+DDDDPx?x?x?x?x? !  x?x?x?x?x?rJ