VL idZddlmZddlZddlZddlZddlmZddl m Z ddl m Z ddl mZejeZddZdd Zd d  dd Z dd Zy)z!Config handling logic for Flake8.) annotationsN)Any) exceptions)VALID_CODE_PREFIX) OptionManagerc\tj|}|j|jfS)N)osstatst_inost_dev)ssts [/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/flake8/options/config.py _stat_keyrs" B 99bii cFtjjd} |dk7r t|nd}t|} dD]V}t j }tjj||} |j|dd|vsd|vsT|cStjj|}t|} | |k(s| |k(r y|}| }#t$rd}YwxYw#tt jf$r!}tjd||Yd}~d}~wwxYw)N~)z setup.cfgztox.iniz.flake8UTF-8encodingflake8zflake8:local-pluginsz"ignoring unparseable config %s: %s)r path expanduserrOSError configparserRawConfigParserjoinreadUnicodeDecodeError ParsingErrorLOGwarningdirname) rhome home_statdir_stat candidatecfgcfg_pathenew_path new_dir_stats r_find_config_filer-s$ 77  c "D'+s{IdO H < $I..0Cww||D)4H $G4 s?&<&C#O $77??4( * 8 #|y'@   D#H'   ' (A(AB O @(ANN Os)C9C& C#"C#&D ?DD F)isolatedctjjd}|rtj|fS| t |}tj}|K|j |dstjd|tjj|}n|}|D]-}|j |drtjd|||fS)a@Load the configuration given the user options. - in ``isolated`` mode, return an empty configuration - if a config file is given in ``config`` use that, otherwise attempt to discover a configuration using ``tox.ini`` / ``setup.cfg`` / ``.flake8`` - finally, load any ``extra`` configuration files .rrz*The specified config file does not exist: ) r rabspathrrr-rrExecutionErrorr#)configextrar.pwdr(cfg_dirfilenames r load_configr88s ''//# C++-s22 ~"3'  & & (C xxx1++|D]9}tj|rtd|d|d tj|jJ|||j<)|S) z4Parse and normalize the typed configuration options.rz(Option "%s" is not registered. Ignoring.count> store_true store_falsezOption "%s" returned value: %r> extend-ignoreignorez Error code z supplied to z option does not match )config_options_dictgetr!debugtypeintactiongetint getboolean normalizermatch ValueErrorpattern config_name) option_managerr(r6 config_dict option_nameoptionvalue final_value error_codes r parse_configrSbsV s K8}6 3377 D > II@+ N  ;;# '!9JJx5E ]]; ;NN8[9EGGHk2E 2KG&&ug6 5 5)  (..z:$%j^4''2o6**;*C*C)FH !!---*5 F&&';6> r)r strreturnztuple[int, int])rrTrU str | None)r3rVr4z list[str]r.boolrUz(tuple[configparser.RawConfigParser, str])rLrr(zconfigparser.RawConfigParserr6rTrUzdict[str, Any])__doc__ __future__rrloggingos.pathr typingrrrflake8.defaultsrflake8.options.managerr getLogger__name__r!rr-r8rSrrrbs'"-0g! L ' ' ' ' . 'T*!* %** *r