btdZddlZddlZddlZddlZddlmZddlmZddlmZddlm Z ddlm Z ddl Z ddl mZdd lmZid d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+id,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZ ZGd[d\e jjZdS)]z8Plugin built-in to Flake8 to treat pyflakes as a plugin.N)Any) Generator)List)Tuple)Type)utils) OptionManager UnusedImportF401ImportShadowedByLoopVarF402ImportStarUsedF403LateFutureImportF404ImportStarUsageF405ImportStarNotPermittedF406FutureFeatureNotDefinedF407PercentFormatInvalidFormatF501PercentFormatExpectedMappingF502PercentFormatExpectedSequenceF503 PercentFormatExtraNamedArgumentsF504PercentFormatMissingArgumentF505$PercentFormatMixedPositionalAndNamedF506$PercentFormatPositionalCountMismatchF507!PercentFormatStarRequiresSequenceF508'PercentFormatUnsupportedFormatCharacterF509StringDotFormatInvalidFormatF521"StringDotFormatExtraNamedArgumentsF522'StringDotFormatExtraPositionalArgumentsF523StringDotFormatMissingArgumentF524StringDotFormatMixingAutomaticF525FStringMissingPlaceholdersF541MultiValueRepeatedKeyLiteralF601MultiValueRepeatedKeyVariableF602%TooManyExpressionsInStarredAssignmentF621TwoStarredExpressionsF622 AssertTupleF631 IsLiteralF632InvalidPrintSyntaxF633IfTupleF634BreakOutsideLoopF701ContinueOutsideLoopF702ContinueInFinallyF703YieldOutsideFunctionF704F706F707F721F722F723F811F821F822F823F831F841F901) ReturnOutsideFunctionDefaultExceptNotLastDoctestSyntaxErrorForwardAnnotationSyntaxErrorCommentAnnotationSyntaxErrorRedefinedWhileUnused UndefinedNameUndefinedExportUndefinedLocalDuplicateArgumentUnusedVariableRaiseNotImplementedceZdZUdZdZgZeeed<gZ eeed<de j dee j dedd ffd Zed edd fd Zed ejdd fdZdeeeeeeefd d ffdZxZS) FlakesCheckerz=Subclass the Pyflakes checker to conform with the flake8 API.Finclude_in_doctestexclude_from_doctesttree file_tokensfilenamereturnNc,tj|j}fd|jD}|rd}|jD]1dkr)rd}fd|D}|rd}2t |||dS)z=Initialize the PyFlakes plugin with an AST tree and filename.cJg|]}|dk|| S) startswith).0includerls /srv/buildsys-work-dir/castor/build_node/builder-2/WGSG1/unpkd_srcs/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/flake8/plugins/pyflakes.py z*FlakesChecker.__init__..Ss<   "}}!4!4W!=!=} }}TrpFc>g|]}||Srq)rsrtexcludes rurvz*FlakesChecker.__init__..^s=   ))'22    rw)rl withDoctestrkN)rnormalize_path with_doctestrhrirrsuper__init__) selfrjrkrlr} included_by overlaped_byrz __class__s ` @rurzFlakesChecker.__init__Js'11(     2    L0 ( (G"}}!4!4W!=!=}$     #.     (#'L  $#      rwparserc |dddd|ddddd |d d d dddd |dd ddddddS)z:Register options for PyFlakes on the Flake8 OptionManager.z --builtinsTz&define more built-ins, comma separated)parse_from_configcomma_separated_listhelpz --doctestsF store_truez!also check syntax of the doctests)defaultactionrrz--include-in-doctestrprhz Run doctests only on these files)rdestrrnormalize_pathsrz--exclude-from-doctestriz&Skip these files when running doctestsN) add_option)clsrs ru add_optionszFlakesChecker.add_optionsns  "!%9     "4      "%"!% 3      $'"!% 9      rwoptionsc|jr$|j|j|_|j|_g}|jD]Y}|dkr |tjddfs| d|D| |Ztj ||_g}|j D]Y}|dkr |tjddfs| d|D| |Ztj ||_ t|j|j }|rt|ddS)z0Parse option values from Flake8's OptionManager.rpz./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)builtinsbuiltInsuniondoctestsr}rhrrossepappendrrriset intersection ValueError)rrincluded_files included_fileexcluded_files excluded_fileinc_excs ru parse_optionszFlakesChecker.parse_optionss   @<--g.>??CL"+$7 5 5M"" ++RVT4,@AA 5%%&:=&:&:;;;;%%m4444!&!6~!F!F$9 5 5M"" ++RVT4,@AA 5%%&:=&:&:;;;;%%m4444#(#8#H#H c,--::  $    (((   rwc #K|jD]q}t|dd}|j|dtt |jd|j|j z|j fVrdS)zRun the plugin.colrz{} {}F999N) messagesgetattrlinenoformatFLAKE8_PYFLAKES_CODESgettype__name__message message_argsr)rrrs rurunzFlakesChecker.runs}  G'5!,,C)--d7mm.DfMMOg&::!      rw)r __module__ __qualname____doc__r}rhrstr__annotations__riastASTtokenize TokenInfor classmethodr rargparse Namespacerrrintrrr __classcell__)rs@rurgrgCs?GGL$&S &&&&($s)(((" g" (,-"  "  " " " " " " H    4    [  D#H$6#4###[#J YuS#sDI%=>dJK        rwrg)rrrrrtypingrrrrrpyflakes.checkerpyflakesflake8rflake8.options.managerr rcheckerCheckerrgryrwrurs>> 000000/F/v/f/ / v / f /v/!&/#F/$V/'/#F/+F/+F/(/ .v!/"#F#//$)&%/&.v'/(%f)/*%f+/,!&-/.#F//0$V1/2,V3/4V5/667/89/:&;/<v=/>?/@6A/BC/DFE//F$" $*$*"!]///d@@@@@H$,@@@@@rw