
    c.                       d Z ddlm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 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dLdMdNdOdPdQdRdSdTdUdVdWdXZ G dY dZe
j        j                  ZdS )[z8Plugin 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ContinueInFinallyF703YieldOutsideFunctionF704F706F707F721F722F811F821F822F823F831F841F842F901)ReturnOutsideFunction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includerj   s     7lib/python3.11/site-packages/flake8/plugins/pyflakes.py
<listcomp>z*FlakesChecker.__init__.<locals>.<listcomp>L   sK     
 
 
"}
 "*!4!4W!=!=

 
 
    Trp   Fc                >    g | ]}|                               |S  rq   )rs   rt   excludes     ru   rv   z*FlakesChecker.__init__.<locals>.<listcomp>W   s=     ! ! !))'22!! ! !rw   )rj   withDoctestN)r   normalize_pathwith_doctestrf   rg   rr   super__init__)selfrh   rj   r}   included_byoverlapped_byrz   	__class__s     `   @ru   r   zFlakesChecker.__init__H   s    '11(
 
 
 
2
 
 

  	 L0 
	( 
	(G"} 	(!4!4W!=!= 	($! ! ! !#.! ! ! ! (#'LlKKKKKrw   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-doctestrp   rf   z Run doctests only on these files)r   destr   r   normalize_pathsr   z--exclude-from-doctestrg   z&Skip these files when running doctestsN)
add_option)clsr   s     ru   add_optionszFlakesChecker.add_optionsb   s     	"!%9	 	 	
 	
 	
 	"4 	 	
 	
 	
 	"%"!% 3 	 	
 	
 	
 	$'"!% 9 	 	
 	
 	
 	
 	
rw   optionsargparse.Namespacec                   |j         r$| j                            |j                   | _        |j        | _        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.rp   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}   rf   rr   ossepappendr   r   rg   setintersection
ValueError)r   r   included_filesincluded_fileexcluded_filesexcluded_fileinc_excs          ru   parse_optionszFlakesChecker.parse_options   s     	@<--g.>??CL"+$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,--::$
 
  	 ( ( (  	 	rw   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      ru   runzFlakesChecker.run   s      } 
	 
	G'5!,,C)--d7mm.DfMMOg&::  !    
	 
	rw   )rh   ri   rj   rk   rl   rm   )r   r   rl   rm   )r   r   rl   rm   )rl   r   )r   
__module____qualname____doc__r}   rf   __annotations__rg   r   classmethodr   r   r   __classcell__)r   s   @ru   re   re   A   s         GGL$&&&&&&(((((L L L L L L4  
  
  
 [ 
D # # # [#J       rw   re   )r   
__future__r   argparseastr   typingr   r   pyflakes.checkerpyflakesflake8r   flake8.options.managerr   r   checkerCheckerre   ry   rw   ru   <module>r      s   > > " " " " " "  



 				                       0 0 0 0 0 0/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 C/D FE/ /F $" $*"!]/ / / dv v v v vH$, v v v v vrw   