
    yIf                        d dl mZ d dlZd dlZd dlmZ d dlmZ d dlmZ d dl	m
Z
 d dlmZ d dlmZ d d	lmZmZ d d
lmZ e
rd dlmZ 	 	 	 dddZddZdS )    )annotationsNglob)chain)Path)TYPE_CHECKING)	reporters)_ConfigurationFileParser)ArgumentPreprocessingError_UnrecognizedOptionError)utils)PyLinterFlinterr   	args_list	list[str]reporter7reporters.BaseReporter | reporters.MultiReporter | Noneconfig_fileNone | str | Pathverbose_modeboolreturnc                   |rt          |          nd}|                     |rt          |          nd           t          ||           }	 |                    |          \  }}nF# t
          $ r9}t          |t          j                   t          j	        d           Y d}~nd}~ww xY wt          |d          }d|v r't          t          j        |d                              d	|v r-|                     t          j        |d	                              d}		 |                     |           n1# t"          $ r$}
d
                    |
j                  }	Y d}
~
nd}
~
ww xY w|r|                     |           |                     d           t          |d          }|                     |          }	 |                    d           n# t.          $ r Y nw xY wg }|D ]g}|                    d          r|                    |dd                    5|                    d          r|                    |dd                    h|rXd
                    |          }	 | j                            d|            n$# t8          $ r t          j	        d           Y nw xY w|	>|                     |rt          |          nd           |                     d|	d           | j        j        D ]+}d|vr%tA          j!        d| d| dtD          ddd           ,| #                                 |                     d           | $                                 | %                                 | &                                 | j        i f| j'        t          d          (                                <   tS          tU          j+        d |D                                 S )zoParse all available options, read config files and command line arguments and
    set options accordingly.
    N )	file_path)file    F)joinedz	init-hookzload-pluginsz, zCommand lineTz--   -   zUnrecognized option found: zunrecognized-optionr   )argsline.'zk' is not a proper value for the 'overgeneral-exceptions' option. Use fully qualified name (maybe 'builtins.zc' ?) instead. This will cease to be checked at runtime when the configuration upgrader is released.z*pylint: Command line or configuration filepylint)categoryfilenamelinenomodulez"Command line or configuration filec              3  >   K   | ]}t          |d           p|gV  dS )T)	recursiveNr   ).0args     W/var/www/piapp/venv/lib/python3.11/site-packages/pylint/config/config_initialization.py	<genexpr>z)_config_initialization.<locals>.<genexpr>   sL       
 
  %%%.#
 
 
 
 
 
    ),r   set_current_modulestrr
   parse_config_fileOSErrorprintsysstderrexit_order_all_firstexecr   _unquoteload_plugin_modules_splitstrip_parse_configuration_filer   joinoptionsset_reporter!_parse_command_line_configurationremove
ValueError
startswithappend_arg_parsererror
SystemExitadd_messageconfigovergeneral_exceptionswarningswarn_explicitUserWarning_emit_stashed_messagesload_plugin_configurationenable_fail_on_messages_parse_error_mode_directory_namespacesresolvelistr   from_iterable)r   r   r   r   r   config_file_parserconfig_dataconfig_argsexunrecognized_options_messageexcparsed_args_listunrecognized_optionsoptmsgexc_names                   r/   _config_initializationrd      s    (3<${###K +Ec+...2FFF 2,GG#5#G#G! $H $
 $
 [[    bsz""""
 #;u===K k!!U^K455666 $$""5#4[5P#Q#QRRR#' >((5555# > > >'+yy'='=$$$$$$>  &H%%% n--- !4888I??	JJ%%%%    ') 1 1>>$ 	1 ''ABB0000^^C   	1 ''ABB000 ii,--	$$%H3%H%HIIII 	 	 	HRLLLLL	
 $/!!k"I#k"2"2"2rJJJ!(D1 	 	
 	
 	

 M8  h"(H ( (=E( ( ( %E	 	 	 	 !!### BCCC $$&&& ""$$$
 :@8KF c!2!2!4!45  
 
 (
 
 
 	
 	
	 	 	sT   A% %
B(//B##B(D1 1
E;EE5G 
GGI= =JJr[   r   c                  g }d}t          |           D ]\  }}|rF|                    d          s|                    d          r|                    d          d         }n|dv r| |dz            }n^dd |                    d	          D             vr|                    d          d
         }|r||k    rt          d          |}|                    |           |s|                    |dz              g }|D ]}|                    | |                    t          |           D ]\  }}||v r
|                    |            |S )a  Reorder config_args such that --enable=all or --disable=all comes first.

    Raise if both are given.

    If joined is True, expect args in the form '--enable=all,for-any-all'.
    If joined is False, expect args in the form '--enable', 'all,for-any-all'.
    r   z	--enable=z
--disable==r!   >   --enable	--disableallc              3  >   K   | ]}|                                 V  d S )N)strip)r-   rb   s     r/   r0   z#_order_all_first.<locals>.<genexpr>   s*      AAAAAAAAr1   ,r   z0--enable=all and --disable=all are incompatible.)	enumeraterF   splitr   rG   )r[   r   indexes_to_prepend
all_actionir.   valuereturned_argss           r/   r:   r:      s    JK(( - -3 	s~~k22 	cnn\6R6R 	IIcNN1%EE---A&EEAAC0@0@AAAAAiinnQ 	3*,,,B   
!!!$$$ 	-%%a!e,,,M - -[^,,,,K(( " "3"""S!!!!r1   )NNF)r   r   r   r   r   r   r   r   r   r   r   r   )r[   r   r   r   r   r   )
__future__r   r7   rN   r   	itertoolsr   pathlibr   typingr   r&   r	    pylint.config.config_file_parserr
   pylint.config.exceptionsr   r   pylint.utilsr   pylint.lintr   rd   r:    r1   r/   <module>r}      s7  
 # " " " " " 



                                      E E E E E E              %$$$$$$ IM%)C C C C CL* * * * * *r1   