
    7 f=                       d Z ddlmZ ddlZddlZddlZddlZddlmZ ddlm	Z	 ddl
ZddlmZ ddlmZ  ej        e          Zi dd	d
dddddddddddddddddddddd d!d"d#d$d%d&d'd(d)i d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWZ G dX dYej        j                  ZdS )Zz8Plugin built-in to Flake8 to treat pyflakes as a plugin.    )annotationsN)Any)	Generator)utils)OptionManagerUnusedImportF401ImportShadowedByLoopVarF402ImportStarUsedF403LateFutureImportF404ImportStarUsageF405ImportStarNotPermittedF406FutureFeatureNotDefinedF407PercentFormatInvalidFormatF501PercentFormatExpectedMappingF502PercentFormatExpectedSequenceF503 PercentFormatExtraNamedArgumentsF504PercentFormatMissingArgumentF505$PercentFormatMixedPositionalAndNamedF506$PercentFormatPositionalCountMismatchF507!PercentFormatStarRequiresSequenceF508'PercentFormatUnsupportedFormatCharacterF509StringDotFormatInvalidFormatF521"StringDotFormatExtraNamedArgumentsF522'StringDotFormatExtraPositionalArgumentsF523StringDotFormatMissingArgumentF524StringDotFormatMixingAutomaticF525FStringMissingPlaceholdersF541MultiValueRepeatedKeyLiteralF601MultiValueRepeatedKeyVariableF602%TooManyExpressionsInStarredAssignmentF621TwoStarredExpressionsF622AssertTupleF631	IsLiteralF632InvalidPrintSyntaxF633IfTupleF634BreakOutsideLoopF701ContinueOutsideLoopF702YieldOutsideFunctionF704ReturnOutsideFunctionF706F707F721F722F811F821F822F823F831F841F842F901)DefaultExceptNotLastDoctestSyntaxErrorForwardAnnotationSyntaxErrorRedefinedWhileUnusedUndefinedNameUndefinedExportUndefinedLocalDuplicateArgumentUnusedVariableUnusedAnnotationRaiseNotImplementedc                  ~     e Zd ZU dZdZg Zded<   g Zded<   d fdZe	dd            Z
e	dd            ZddZ xZS )FlakesCheckerz=Subclass the Pyflakes checker to conform with the flake8 API.Fz	list[str]include_in_doctestexclude_from_doctesttreeast.ASTfilenamestrreturnNonec                *   t          j                  | j        }fd| j        D             }|rd}| j        D ]1dk    r)                              rd}fd|D             }|rd}2t                                          ||           dS )z=Initialize the PyFlakes plugin with an AST tree and filename.c                J    g | ]}|d k                         |          | S ) 
startswith).0includerh   s     M/var/www/equiseq/venv/lib/python3.11/site-packages/flake8/plugins/pyflakes.py
<listcomp>z*FlakesChecker.__init__.<locals>.<listcomp>N   s<     
 
 
"}}!4!4W!=!=} }}    Trn   Fc                >    g | ]}|                               |S  ro   )rq   rr   excludes     rs   rt   z*FlakesChecker.__init__.<locals>.<listcomp>Y   s=     ! ! !))'22!! ! !ru   )rh   withDoctestN)r   normalize_pathwith_doctestrd   re   rp   super__init__)selfrf   rh   r{   included_byoverlapped_byrx   	__class__s     `   @rs   r}   zFlakesChecker.__init__J   s    '11(
 
 
 
2
 
 

  	 L0 
	( 
	(G"}}!4!4W!=!=}$! ! ! !#.! ! ! ! (#'LlKKKKKru   parserr   c           	         |                     dddd           |                     ddddd	           |                     d
dddddd           |                     ddddddd           dS )z:Register options for PyFlakes on the Flake8 OptionManager.z
--builtinsTz&define more built-ins, comma separated)parse_from_configcomma_separated_listhelpz
--doctestsF
store_truez!also check syntax of the doctests)defaultactionr   r   z--include-in-doctestrn   rd   z Run doctests only on these files)r   destr   r   normalize_pathsr   z--exclude-from-doctestre   z&Skip these files when running doctestsN)
add_option)clsr   s     rs   add_optionszFlakesChecker.add_optionsd   s     	"!%9	 	 	
 	
 	
 	"4 	 	
 	
 	
 	"%"!% 3 	 	
 	
 	
 	$'"!% 9 	 	
 	
 	
 	
 	
ru   optionsargparse.Namespacec                4   |j         r$| j                            |j                   | _        |j        | _        |j        s|j        rt                              d           g }|j        D ]Y}|dk    r	|	                    t          j        ddf          s|                    d|            D|                    |           Zt          j        |          | _        g }|j        D ]Y}|dk    r	|	                    t          j        ddf          s|                    d|            D|                    |           Zt          j        |          | _        t          | j                                      | j                  }|rt#          |d          dS )z0Parse option values from Flake8's OptionManager.zi--include-in-doctest / --exclude-from-doctest will be removed in a future version.  see PyCQA/flake8#1747rn   z./z~/z was specified in both the include-in-doctest and exclude-from-doctest options. You are not allowed to specify it in both for doctesting.N)builtinsbuiltInsuniondoctestsr{   rd   re   LOGwarningrp   ossepappendr   r   setintersection
ValueError)r   r   included_filesincluded_fileexcluded_filesexcluded_fileinc_excs          rs   parse_optionszFlakesChecker.parse_options   s     	@<--g.>??CL"+% 	)E 	KKF  
 $7 	5 	5M"" ++RVT4,@AA 5%%&:=&:&:;;;;%%m4444!&!6~!F!F$9 	5 	5M"" ++RVT4,@AA 5%%&:=&:&:;;;;%%m4444#(#8#H#H c,--::$
 
  	 ( ( (  	 	ru   6Generator[tuple[int, int, str, type[Any]], None, None]c           
   #     K   | j         D ]q}t          |dd          }|j        |d                    t                              t          |          j        d          |j        |j	        z            |j
        fV  rdS )zRun the plugin.colr   z{} {}F999N)messagesgetattrlinenoformatFLAKE8_PYFLAKES_CODESgettype__name__messagemessage_argsr   )r~   r   r   s      rs   runzFlakesChecker.run   s      } 
	 
	G'5!,,C)--d7mm.DfMMOg&::  !    
	 
	ru   )rf   rg   rh   ri   rj   rk   )r   r   rj   rk   )r   r   rj   rk   )rj   r   )r   
__module____qualname____doc__r{   rd   __annotations__re   r}   classmethodr   r   r   __classcell__)r   s   @rs   rc   rc   C   s         GGL$&&&&&&(((((L L L L L L4  
  
  
 [ 
D ) ) ) [)V       ru   rc   )r   
__future__r   argparseastloggingr   typingr   r   pyflakes.checkerpyflakesflake8r   flake8.options.managerr   	getLoggerr   r   r   checkerCheckerrc   rw   ru   rs   <module>r      s   > > " " " " " "  



  				                       0 0 0 0 0 0g!!.F.v. f. 	.
 v. f. v. !&. #F. $V. '. #F. +F. +F. (.  .v!." #F#. .$ )&%.& .v'.( %f).* %f+., !&-.. #F/.0 $V1.2 ,V3.4 V5.6 67.8 9.: &;.< v=.> ?.@ 6A.B FC.D VE. .F # $*"![. . . b| | | | |H$, | | | | |ru   