ok

Mini Shell

Direktori : /opt/cloudlinux/venv/lib/python3.11/site-packages/pydocstyle/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/pydocstyle/__pycache__/config.cpython-311.pyc

�

�܋fЂ��j�dZddlZddlZddlZddlZddlZddlmZddlm	Z	ddl
mZmZm
Z
ddlmZddlmZdd	lmZdd
lmZddlmZmZejdkrddlZn	ddlZn
#e$rdZYnwxYwd
�ZGd�d��ZGd�d��Zedd��Z Gd�de!��Z"edd��Z#dS)z)Configuration file parsing and utilities.�N)�
namedtuple)�Set)�
NoOptionError�NoSectionError�RawConfigParser)�reduce)�compile�)�__version__)�log)�
ErrorRegistry�conventions)��c����fd�}|S)z4Check that the configuration object was initialized.c�V��|j�|j�td����|g|�Ri|��S)Nz$using an uninitialized configuration)�
_arguments�_options�RuntimeError)�self�args�kwargs�methods   ��b/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/pydocstyle/config.py�
_decoratorz%check_initialized.<locals>._decoratorsA����?�"�d�m�&;��E�F�F�F��v�d�,�T�,�,�,�V�,�,�,��)rrs` r�check_initializedrs$���-�-�-�-�-�
�rc�L�eZdZdZd�Zd
d�Zdd�Zd�Zd�Zdd	�d
�Z	d�Z
d�ZdS)�
TomlParseraConfigParser that partially mimics RawConfigParser but for toml files.

    See RawConfigParser for more info. Also, please note that not all
    RawConfigParser functionality is implemented, but only the subset that is
    currently used by pydocstyle.
    c��i|_dS)zCreate a toml parser.N)�_config�rs r�__init__zTomlParser.__init__.s
������rNc��t|tttjf��r|g}g}|D]�}	t|d��5}ts"tjd|��	ddd���=|j	�
t
j|����ddd��n#1swxYwYn#t$rY��wxYwt|tj��rtj
|��}|�|����|S)a�Read and parse a filename or an iterable of filenames.

        Files that cannot be opened are silently ignored; this is
        designed so that you can specify an iterable of potential
        configuration file locations (e.g. current directory, user's
        home directory, systemwide directory), and all existing
        configuration files in the iterable will be read.  A single
        filename may also be given.

        Return list of successfully read files.
        �rbzTThe %s configuration file was ignored, because the `tomli` package is not installed.N)�
isinstance�str�bytes�os�PathLike�open�tomllibr�warningr"�update�load�OSError�fspath�append)r�	filenames�encoding�read_ok�filename�fps      r�readzTomlParser.read2sp���i�#�u�b�k�!:�;�;�	$�"��I���!�	%�	%�H�
��(�D�)�)�:�R�"�!���L�$����
!�:�:�:�:�:�:�:��L�'�'���R�(8�(8�9�9�9�:�:�:�:�:�:�:�:�:�:�:����:�:�:�:����
�
�
���
�����(�B�K�0�0�
/��9�X�.�.���N�N�8�$�$�$�$��sA�B0�B$� B0�,,B$�B0�$B(	�(B0�+B(	�,B0�0
B=�<B=Fc���	ttj|�d��|jd��}n#t
$rd}YnwxYwt
|t��r|S|rdSt|���)N�.�tool)	r�operator�getitem�splitr"�KeyErrorr'�dictr)r�section�
allow_none�currents    r�_get_sectionzTomlParser._get_sectionSs���	��� ��
�
�c�"�"���V�$���G�G��
�	�	�	��G�G�G�	�����g�t�$�$�	*��N�
�	*��4� ��)�)�)s�9<�A�
Ac�4�|�|d���duS)zCIndicate whether the named section is present in the configuration.T)rCN)rE)rrBs  r�has_sectionzTomlParser.has_sectionds ��� � ��T� �:�:�$�F�Frc�n�|�|��}t|�����S)z9Return a list of option names for the given section name.)rE�list�keys)rrBrDs   r�optionszTomlParser.optionshs+���#�#�G�,�,���G�L�L�N�N�#�#�#r��_convc�R�|�|��}|���}	||}n#t$rt||���wxYwt	|t
��rt
d|�d|�d����|�(t	||��st
d|�d|�d|�����|S)z(Get an option value for a given section.z	Expected r;z  to be an option, not a section.NzThe type of z should be )rE�lowerr@rr'rA�	TypeError)rrB�optionrM�d�values      r�getzTomlParser.getms������g�&�&��������	1��f�I�E�E���	1�	1�	1����0�0�0�	1�����e�T�"�"�	��N�G�N�N�f�N�N�N���
���Z��u�%=�%=���C�w�C�C��C�C�E�C�C���
��s	�4�Ac�<�|�||t���S)z/Get a boolean option value for a given section.rL)rT�bool�rrBrQs   r�
getbooleanzTomlParser.getboolean�s���x�x���t�x�4�4�4rc�<�|�||t���S)z0Get an integer option value for a given section.rL)rT�intrWs   r�getintzTomlParser.getint�s���x�x���s�x�3�3�3r�N)F)�__name__�
__module__�__qualname__�__doc__r$r9rErGrKrTrXr[rrrr r &s����������������B*�*�*�*�"G�G�G�$�$�$�
-1������.5�5�5�4�4�4�4�4rr c���eZdZdZdZdZdZdZdZdZ	e
jZdZ
d	Zd
Zd�Zd�Zd
�Zed���Zed���Zd�Zd�Zed���Zd�Zd�Zd$d�Zed���Zed%d���Zed���Z ed���Z!ed���Z"ed���Z#ed���Z$ed���Z%ed ���Z&ed!���Z'ed"���Z(ed#���Z)dS)&�ConfigurationParseraResponsible for parsing configuration from files and CLI.

    There are 2 types of configurations: Run configurations and Check
    configurations.

    Run Configurations:
    ------------------
    Responsible for deciding things that are related to the user interface and
    configuration discovery, e.g. verbosity, debug options, etc.
    All run configurations default to `False` or `None` and are decided only
    by CLI.

    Check Configurations:
    --------------------
    Configurations that are related to which files and errors will be checked.
    These are configurable in 2 ways: using the CLI, and using configuration
    files.

    Configuration files are nested within the file system, meaning that the
    closer a configuration file is to a checked file, the more relevant it will
    be. For instance, imagine this directory structure:

    A
    +-- tox.ini: sets `select=D100`
    +-- B
        +-- foo.py
        +-- tox.ini: sets `add-ignore=D100`

    Then `foo.py` will not be checked for `D100`.
    The configuration build algorithm is described in `self._get_config`.

    Note: If any of `BASE_ERROR_SELECTION_OPTIONS` was selected in the CLI, all
    configuration files will be ignored and each file will be checked for
    the error codes supplied in the CLI.

    )	�
convention�select�ignorez
add-selectz
add-ignore�matchz	match-dirzignore-decoratorszignore-self-only-init)rerdrcz(?!test_).*\.pyz[^\.].*�z2property,cached_property,functools.cached_propertyF)z	setup.cfgztox.iniz.pydocstylez.pydocstyle.iniz
.pydocstylercz.pydocstylerc.inizpyproject.tomlz.pep257)�
pydocstyle�pep257c�~�i|_d|_dx|_x|_|_|���|_dS)zCreate a configuration parser.N)�_cache�_override_by_clirr�	_run_conf�_create_option_parser�_parserr#s rr$zConfigurationParser.__init__�s=����� $���;?�?��
�?���$�.��1�1�3�3����rc�\�|�g��\}}|�|��S)z;Return a `RunConfiguration` object set with default values.)�_parse_args�_create_run_config)rrK�_s   r�get_default_run_configurationz1ConfigurationParser.get_default_run_configuration�s-���%�%�b�)�)�
����&�&�w�/�/�/rc�:�|���\|_|_|jpdg|_|�|j��st	���|�|j��|_|�|jd���}||_dS)z�Parse the configuration.

        If one of `BASE_ERROR_SELECTION_OPTIONS` was selected, overrides all
        error codes to check and disregards any error code related
        configurations from the configuration files.

        r;F)�use_defaultsN)	rqrr�_validate_options�IllegalConfigurationrrrm�_create_check_configrl)r�configs  r�parsezConfigurationParser.parse�s���*.�)9�)9�);�);�&��
�t���/�2�c�U����%�%�d�m�4�4�	)�&�(�(�(��0�0���?�?����*�*�4�=�u�*�M�M�� &����rc��|jS)z,Return the run configuration for the script.)rmr#s r�get_user_run_configurationz.ConfigurationParser.get_user_run_configuration�s���~�rc#��K�d�}d�}d�}|jD�]�}tj�|��r�tj|��D]�\}}}|�tj�|����}||��\}	�||��}
||��}�fd�|D��|dd�<ttjj|��D]M}|	|��r@tj�	||��}
|
t|j��|
||jfV��N�ݐ�|�tj�|����}||��\}	}||��}
||��}|	tj�|����r |t|j��|
||jfV����dS)a�Generate files and error codes to check on each one.

        Walk dir trees under `self._arguments` and yield file names
        that `match` under each directory that `match_dir`.
        The method locates the configuration for each file name and yields a
        tuple of (filename, [error_codes]).

        With every discovery of a new configuration file `IllegalConfiguration`
        might be raised.

        c�z�t|jdz��j}t|jdz��j}||fS)z:Return the `match` and `match_dir` functions for `config`.�$)�rerf�	match_dir)�conf�
match_func�match_dir_funcs   r�_get_matchesz<ConfigurationParser.get_files_to_check.<locals>._get_matchess;���D�J��,�-�-�3�J����� 4�5�5�;�N��~�-�-rc�<�|jrt|j��ndS)z0Return the `ignore_decorators` as None or regex.N)�ignore_decoratorsr��r�s r�_get_ignore_decoratorszFConfigurationParser.get_files_to_check.<locals>._get_ignore_decoratorss$��/3�.D�N��4�)�*�*�*�$�
rc�b�|jr't|j�d����ndS)z0Return the `property_decorators` as None or set.�,N)�property_decorators�setr?r�s r�_get_property_decoratorszHConfigurationParser.get_files_to_check.<locals>._get_property_decoratorss5���+���D�,�2�2�3�7�7�8�8�8��
rc�*��g|]}�|���
|��Srr)�.0rRr�s  �r�
<listcomp>z:ConfigurationParser.get_files_to_check.<locals>.<listcomp>(s&���?�?�?�Q�)�)�A�,�,�?�q�?�?�?rN)
rr*�path�isdir�walk�_get_config�abspath�map�basename�joinrI�
checked_codes�ignore_self_only_init)rr�r�r��name�root�dirsr4rzrfr�r�r7�	full_pathrsr�s               @r�get_files_to_checkz&ConfigurationParser.get_files_to_check�s+�����	.�	.�	.�	�	�	�	�	�	��O�!	�!	�D��w�}�}�T�"�"� 
�-/�W�T�]�]���)�D�$�	�!�-�-�b�g�o�o�d�.C�.C�D�D�F�'3�|�F�';�';�$�E�9�(>�(>�v�(F�(F�%�*B�*B�6�*J�*J�'�@�?�?�?�$�?�?�?�D����G�$'���(8�)�$D�$D�	�	�� �5��?�?��(*����T�8�(D�(D�I� )� $�V�%9� :� :� 1� 3� &� <�#�����	��(�)�)�"�'�/�/�$�*?�*?�@�@��'�<��/�/���q�$:�$:�6�$B�$B�!�&>�&>�v�&F�&F�#��5���)�)�$�/�/�0�0����V�1�2�2�)�+��4������7!	�!	rc�2�|�|��}||jvr
|j|S|�|��}|�Utj�|��\}}|r|�|��}n�|�|j��}n|�	|��\}}tj�|��\}}|r.|r,|�|��}	|�
|	|��}n|�|��}|S)awGet a configuration for checking `node` by config discovery.

        Config discovery happens when no explicit config file is specified. The
        file system is searched for config files starting from the directory
        containing the file being checked, and up until the root directory of
        the project.

        See `_get_config` for further details.

        )�
_get_node_dirrk�_get_config_file_in_folderr*r�r?r�ryr�_read_configuration_file�_merge_configuration)
r�noder��config_file�
parent_dir�tailrzrK�inherit�
parent_configs
          r�_get_config_by_discoveryz,ConfigurationParser._get_config_by_discoveryDs���!�!�$�'�'���4�;����;�t�$�$��5�5�d�;�;����!�w�}�}�T�2�2��J���
B��)�)�*�5�5����2�2�4�=�A�A��� $�<�<�[�I�I��G�W�!�w�}�}�T�2�2��J���
<��
<� $� 0� 0�� <� <�
��2�2�=�'�J�J����2�2�7�;�;���
rc��|jj�*tjd��|�|��}n�tjd|jj��t
j�|jj��s,td�	|jj�����d|j
vr
|j
dS|�|jj��\}}|�/tjd��|�
|j��}n|�
|��}i}tjD]0}t#|j|��}t#||��}|�|n|||<�1tdi|��}|�|j|j��|jj�||j
d<n||j
|�|��<|S)a�Get and cache the run configuration for `node`.

        If no configuration exists (not local and not for the parent node),
        returns and caches a default configuration.

        The algorithm:
        -------------
        * If the current directory's configuration exists in
           `self._cache` - return it.
        * If a configuration file does not exist in this directory:
          * If the directory is not a root directory:
            * Cache its configuration as this directory's and return it.
          * Else:
            * Cache a default configuration and return it.
        * Else:
          * Read the configuration file.
          * If a parent directory exists AND the configuration file
            allows inheritance:
            * Read the parent configuration by calling this function with the
              parent directory as `node`.
            * Merge the parent configuration with the current one and
              cache it.
        * If the user has specified one of `BASE_ERROR_SELECTION_OPTIONS` in
          the CLI - return the CLI configuration with the configuration match
          clauses
        * Set the `--add-select` and `--add-ignore` CLI configurations.

        Nz&No config file specified, discovering.zUsing config file %rz=Configuration file {!r} specified via --config was not found.zVConfiguration file does not contain a pydocstyle section. Using default configuration.r)rmrzr�debugr�r*r��existsrx�formatrkr�r.ryr�CheckConfiguration�_fields�getattrrl�_set_add_optionsr�r�)	rr�rzrKrs�final_config�attr�cli_val�conf_vals	         rr�zConfigurationParser._get_configns���:�>� �(��I�>�?�?�?��2�2�4�8�8�F�F��I�,�d�n�.C�D�D�D��7�>�>�$�.�"7�8�8�
�*�2�28�&���9N�2O�2O����
�t�{�"�"��{�4�(�(��6�6�t�~�7L�M�M�J�G�Q�����G�����2�2�4�=�A�A����2�2�7�;�;����&�.�	N�	N�D��d�3�T�:�:�G��v�t�,�,�H�,3�,?���X�L����#�3�3�l�3�3�����f�2�D�M�B�B�B��>� �,� &�D�K����4:�D�K��*�*�4�0�0�1��
rc��tj�|��}tj�|��r|ntj�|��S)z?Return the absolute path of the directory of a filesystem node.)r*r�r�r��dirname)r�r�s  rr�z!ConfigurationParser._get_node_dir�sB���w���t�$�$���w�}�}�T�*�*�E�t�t������0E�0E�Erc��|�d��rt��}ntd���}d}d}|�|���r�|�|���ry|jjdd�}|jjD]}|�|j���d�|D��}|�	g��\}}	|�|��}
|�
|
��D]�}|dkr|�|
|��}�|�dd	��|j
vrtjd
|�d����U|�d	d��}||}
|
dvr|�|
|��}n9|
d
kr|�|
|��}n|
dvsJ�|�|
|��}t%|||����|�|��}|�'|�|��st+d|�����||fS)z�Try to read and parse `path` as a configuration file.

        If the configurations were illegal (checked with
        `self._validate_options`), raises `IllegalConfiguration`.

        Returns (options, should_inherit).

        �.toml��#�;��inline_comment_prefixesNTc�6�i|]}|j|jp|j��Sr)�dest�type�action)r��os  r�
<dictcomp>z@ConfigurationParser._read_configuration_file.<locals>.<dictcomp>�s%��K�K�K�!�1�6�1�6�#5�Q�X�K�K�Krr�rs�-zUnknown option 'z	' ignored)rZ�count�string)�
store_true�store_falsez	in file: )�endswithr rr9�_get_section_namero�option_list�
option_groups�extendrqrKrX�replace�CONFIG_FILE_OPTIONSrr.r[rT�setattr�_fix_set_optionsrwrx)rr��parserrK�should_inherit�all_options�groupr��new_optionsrs�section_name�opt�normalized_opt�opt_typerSs               rr�z,ConfigurationParser._read_configuration_file�sO���=�=��!�!�	I��\�\�F�F�$�Z�H�H�H�F������;�;�t���!	9��!7�!7��!?�!?�!	9��,�2�1�1�1�5�K���3�
6�
6���"�"�5�#4�5�5�5�5�K�K�{�K�K�K�K�"�-�-�b�1�1�N�K�� �1�1�&�9�9�L��~�~�l�3�3�
<�
<���)�#�#�%+�%6�%6�|�S�%I�%I�N���;�;�s�C�(�(��0H�H�H��K� A�3� A� A� A�B�B�B��!$���S�#�!6�!6��&�~�6���/�/�/�"�M�M�,��<�<�E�E���)�)�"�J�J�|�S�9�9�E�E�#�'D�D�D�D�D�"�-�-�l�C�@�@�E���^�U�;�;�;�;��+�+�K�8�8�G����)�)�'�2�2�
?�*�+=�t�+=�+=�>�>�>���&�&rc�D�tj|j��}|�|��r|�|��}|�||��t
|���}dD])}t||��}|�|nt||��||<�*tdi|��S)z�Merge parent config into the child options.

        The migration process requires an `options` object for the child in
        order to distinguish between mutually exclusive codes, add-select and
        add-ignore error codes.

        �r��rfr�r�r�r�Nr)	�copy�deepcopyr��_has_exclusive_option�_get_exclusive_error_codesr�rAr�r�)rr��
child_options�error_codesr�key�child_values       rr�z(ConfigurationParser._merge_configuration�s����m�M�$?�@�@���%�%�m�4�4�	I��9�9�-�H�H�K����k�=�9�9�9��K�0�0�0��
�	�	�C�"�-��5�5�K��*����]�C�0�0�
�3�K�K�
"�+�+�F�+�+�+rNc�l�|j�||��\}}|�|��|fS)z@Parse the options using `self._parser` and reformat the options.)ro�
parse_argsr�)rr�valuesrK�	argumentss     rrqzConfigurationParser._parse_argss7��!�\�4�4�T�6�B�B�����$�$�W�-�-�y�8�8rc�L���fd�tjD��}tdi|��S)z2Create a `RunConfiguration` object from `options`.c�2��i|]}|t�|����Sr�r��r�r�rKs  �rr�z:ConfigurationParser._create_run_config.<locals>.<dictcomp>s2���
�
�
�+.�C���#�&�&�
�
�
rr)�RunConfigurationr�)rKr�s` rrrz&ConfigurationParser._create_run_configsD���
�
�
�
�2B�2J�
�
�
�� �)�)�&�)�)�)rTc�J�d}|�|��s|r|�|��}t|���}dddddd�}|���D]=\}}t	||���|rt	|d	|����nt	||��||<�>td
i|��S)z�Create a `CheckConfiguration` object from `options`.

        If `use_defaults`, any of the match options that are `None` will
        be replaced with their default value and the default convention will be
        set for the checked codes.

        Nr��MATCH_RE�MATCH_DIR_RE�IGNORE_DECORATORS_RE�PROPERTY_DECORATORS�IGNORE_SELF_ONLY_INITr��DEFAULT_r)r��_get_checked_errorsrA�itemsr�r�)�clsrKrvr�r�defaultsr��defaults        rryz(ConfigurationParser._create_check_config s����
��$�$�W�-�-�	=��	=��3�3�G�<�<�M��M�2�2�2���'�!7�#8�%<�
�
��%�N�N�,�,�	�	�L�C���7�C�(�(�0�\�0���1��1�1�2�2�2��W�c�*�*�
�3�K�K�
"�+�+�F�+�+�+rc�L�|jD]}|�|��r|cS�dS)z$Parse options from relevant section.N)�POSSIBLE_SECTION_NAMESrG)r�r�r�s   rr�z%ConfigurationParser._get_section_name>sD�� �6�	$�	$�L��!�!�,�/�/�
$�#�#�#�#�
$��trc��tj�|��rtj�|��}|jD]�}|�d��rt
��}ntd���}tj�||��}|�	|��r|�
|��r|cS��dS)zkLook for a configuration file in `path`.

        If exists return its full path, otherwise None.

        r�r�r�N)r*r��isfiler��PROJECT_CONFIG_FILESr�r rr�r9r�)r�r��fnrzr�s     rr�z.ConfigurationParser._get_config_file_in_folderGs����7�>�>�$���	)��7�?�?�4�(�(�D��*�	!�	!�B��{�{�7�#�#�
M�#�����(��L�L�L������T�2�.�.�I��{�{�9�%�%�
!�#�*?�*?��*G�*G�
!� � � � ��	!�	!rc�B�ttj����}d}|j� |�|j��}||z
}nC|j�|�|j��}n!|j�tt|j��}tj
|��S)z;Extract the error codes from the selected exclusive option.N)r�r
�get_error_codesre�_expand_error_codesrdrcr�rr�r�)r�rK�codesr��ignoreds     rr�z.ConfigurationParser._get_exclusive_error_codesZs����M�1�3�3�4�4���
��>�%��-�-�g�n�=�=�G�!�G�O�M�M�
�^�
'��3�3�G�N�C�C�M�M�
�
�
+�#�K��1C�D�D�M��}�]�+�+�+rc�z�||�|j��z}||�|j��z}dS)z@Set `checked_codes` by the `add_ignore` or `add_select` options.N)r�
add_select�
add_ignore)r�r�rKs   rr�z$ConfigurationParser._set_add_optionsks>��	��0�0��1C�D�D�D�
���0�0��1C�D�D�D�
�
�
rc�X��ttj����}t��}	|D]S�������s��fd�|D��}|st	jd���|�|���Tn"#t$r}t|��|�d}~wwxYw|S)z0Return an expanded set of error codes to ignore.c�>��h|]}|�����|��Sr)�
startswith)r��code�parts  �r�	<setcomp>z:ConfigurationParser._expand_error_codes.<locals>.<setcomp>s:��� � � �!�d�o�o�d�.C�.C� �� � � rz9Error code passed is not a prefix of any known errors: %sN)	r�r
r�striprr.r/rPrx)�
code_partsr	�expanded_codes�codes_to_add�ers     @rrz'ConfigurationParser._expand_error_codesqs�����M�1�3�3�4�4������	1�"�
4�
4���z�z�|�|����� � � � �%*� � � ��$���K�+�����
�%�%�l�3�3�3�3�!
4��"�	1�	1�	1�&�q�)�)�q�0�����	1�����s�AB�
B'�B"�"B'c�n�|�|��}|�|j}|�||��|S)z6Extract the codes needed to be checked from `options`.)r��DEFAULT_CONVENTIONr�)r�rKr�s   rr�z'ConfigurationParser._get_checked_errors�sA���6�6�w�?�?�
�� ��2�M����]�G�4�4�4��rc	��tj|jd��D]P\}}t||��r;t||��r+t	jd�||����dS�Q|jra|jtvrSt	jd�|jd�	tj
��������dSdS)z�Validate the mutually exclusive options.

        Return `True` iff only zero or one of `BASE_ERROR_SELECTION_OPTIONS`
        was selected.

        �z8Cannot pass both {} and {}. They are mutually exclusive.Fz1Illegal convention '{}'. Possible conventions: {}�, T)�	itertools�permutations�BASE_ERROR_SELECTION_OPTIONSr�r�errorr�rcrr�rJ)r�rK�opt1�opt2s    rrwz%ConfigurationParser._validate_options�s���$�0��,�a�
�
�	�	�J�D�$��w��%�%�
�'�'�4�*@�*@�
��	�*�*0�&��t�*<�*<�����u�u����	�'�"4�K�"G�"G��I�C�J�J��&��	�	�+�2B�2D�2D�(E�(E���
�
�
�
�5��trc�D��t�fd�|jD����S)z>Return `True` iff one or more exclusive options were selected.c�4��g|]}t�|��du��Sr\r�r�s  �rr�z=ConfigurationParser._has_exclusive_option.<locals>.<listcomp>�s8���
�
�
�����%�%�T�1�
�
�
r)�anyr )r�rKs `rr�z)ConfigurationParser._has_exclusive_option�s@����
�
�
�
��;�
�
�
�
�
�	
rc���d}d}�fd�}|D].}t||��}|�t||||�����/|D]G}t||��}|�d}t|t��s||��}t|||���H|S)z9Alter the set options from None/strings to sets in place.)rerd)r
rc���t|t��r|�d��}��d�|D��dhz
��S)z�Split `value_str` by the delimiter `,` and return a set.

            Removes empty values ('') and strips whitespace.
            Also expands error code prefixes, to avoid doing this for every
            file.

            r�c�6�h|]}|�����Sr)r)r��xs  rrzIConfigurationParser._fix_set_options.<locals>._get_set.<locals>.<setcomp>�s ��.�.�.�q������.�.�.rrg)r'r(r?r)�	value_strr�s �r�_get_setz6ConfigurationParser._fix_set_options.<locals>._get_set�sX����)�S�)�)�
1�%�O�O�C�0�0�	��*�*�.�.�I�.�.�.�"��5���
rNrg)r�r�r'r)r�rK�optional_set_options�mandatory_set_optionsr,r�rSs`      rr�z$ConfigurationParser._fix_set_options�s���� 4�� <��	�	�	�	�	�(�	7�	7�C��G�S�)�)�E�� ����h�h�u�o�o�6�6�6��(�	)�	)�C��G�S�)�)�E��}����e�S�)�)�
(� �������G�S�%�(�(�(�(��rc
���ddlm}m}|td���}|j}|ddddd	�
��|ddddd
�
��|ddddd�
��|ddddd�
��|dddd�
��|dddd���|�||dd����||dd��}|j}|dd dd!���|d"d dd#���|d$d%dd&�d'�t�������|d(d dd)���|d*d dd+���|d,ddd-�.��|�|��|d/d0dd1�|j	�����|d2d0dd3�|j
�����|d4d5dd6�|j�����|d7d8dd9�|j�����|S):z<Return an option parser to parse the command line arguments.r)�OptionGroup�OptionParserz+Usage: pydocstyle [options] [<file|dir>...])�version�usagez-ez	--explainr�Fzshow explanation of each error)r�r��helpz-sz--sourcezshow source for each errorz-dz--debugzprint debug informationz-vz	--verbosezprint status informationz--countz&print total number of errors to stdoutz--configz<path>Nz2use given config file and disable config discovery)�metavarr�r4�Notez�When using --match, --match-dir or --ignore-decorators consider whether you should use a single quote (') or a double quote ("), depending on your OS, Shell, etc.zError Check Optionsa�Only one of --select, --ignore or --convention can be specified. If none is specified, defaults to `--convention=pep257`. These three options select the "basic list" of error codes to check. If you wish to change that list (for example, if you selected a known convention but wish to ignore a specific error from it or add a new one) you can use `--add-[ignore/select]` in order to do so.z--selectz<codes>z�choose the basic list of checked errors by specifying which errors to check for (with a list of comma-separated error codes or prefixes). for example: --select=D101,D2z--ignorez�choose the basic list of checked errors by specifying which errors to ignore out of all of the available error codes (with a list of comma-separated error codes or prefixes). for example: --ignore=D101,D2z--conventionz<name>zgchoose the basic list of checked errors by specifying an existing convention. Possible conventions: {}.rz--add-selectzpadd extra error codes to check to the basic list of errors previously set by --select, --ignore or --convention.z--add-ignorezsignore extra error codes by removing them from the basic list previously set by --select, --ignore or --convention.z--ignore-self-only-initz5ignore __init__ methods which only have a self param.)r�r�r4z--matchz	<pattern>z�check only files that exactly match <pattern> regular expression; default is --match='{}' which matches files that don't start with 'test_' but end with '.py'z--match-dirz�search only dirs that exactly match <pattern> regular expression; default is --match-dir='{}', which matches all dirs that don't start with a dotz--ignore-decoratorsz<decorators>z�ignore any functions or methods that are decorated by a function with a name fitting the <decorators> regular expression; default is --ignore-decorators='{}' which does not ignore any decorated functions.z--property-decoratorsz<property-decorators>z�consider any method decorated with one of these decorators as a property, and consequently allow a docstring which is not in imperative mood; default is --property-decorators='{}')
�optparser0r1r�
add_option�add_option_groupr�r�r�DEFAULT_MATCH_RE�DEFAULT_MATCH_DIR_RE�DEFAULT_IGNORE_DECORATORS_RE�DEFAULT_PROPERTY_DECORATORS)r�r0r1r�rQ�check_group�	add_checks       rrnz)ConfigurationParser._create_option_parser�s���	7�6�6�6�6�6�6�6����?�
�
�
��
�"��	������1�	
�	
�	
�	
�	������-�	
�	
�	
�	
�	������*�	
�	
�	
�	
�	������+�	
�	
�	
�	
�	�����9�		
�	
�	
�	
�	�����E�		
�	
�	
�	
�	����K���4�
�
�	
�	
�	
�"�k��!�
=�

�

�� �*�	�	�	����,�		
�	
�	
�	
�	�	����,�			
�		
�		
�		
�	�	����@�@F���	�	�+�&�&�A�A�	
�	
�	
�	
�	�	�����		
�	
�	
�	
�	�	�����		
�	
�	
�	
�	�	�%���H�		
�	
�	
�	
�	����,�,�,�	�������f�S�)�*�*�
	
�
	
�
	
�
	
�	�������f�S�-�.�.�
	
�
	
�
	
�
	
�	��!�"��B�CI�&��4�C�C�	
�	
�	
�	
�	��#�+��0�17���3�1�1�	
�	
�	
�	
��
r)NN)T)*r]r^r_r`r�r r:r;r<r=rrir�DEFAULT_IGNORE_SELF_ONLY_INITrrr$rtr{rr}r�r�r��staticmethodr�r�r�rqrr�classmethodryr�r�r�r�rr�rwr�r�rnrrrrbrb�s�������#�#�J
��$F� �)��%��#%� �<� �%�+��$)�!�
��6��4�4�4�0�0�0�
'�'�'�&�������B�B���B�L(�(�(�TE�E�E�N�F�F��\�F�
7'�7'�7'�r,�,�,�>9�9�9�9�
�*�*��\�*��,�,�,��[�,�:����[���!�!��[�!�$�,�,��[�,� �E�E��[�E�
����\��8����[������[��4�
�
��[�
��"�"��[�"�H�v�v��[�v�v�vrrbr�)r�rfr�r�r�r�c��eZdZdZdS)rxz(An exception for illegal configurations.N)r]r^r_r`rrrrxrx�s������2�2��Drrxr�)�explain�sourcer��verboser�rz)$r`r�rr=r*�sys�collectionsr�collections.abcr�configparserrrr�	functoolsrr�r	�_versionr�utilsr�
violationsr
r�version_infor-�tomli�ImportErrorrr rbr��	Exceptionrxr�rrr�<module>rSs��/�/�������������	�	�	�	�
�
�
�
�"�"�"�"�"�"�������G�G�G�G�G�G�G�G�G�G�������������!�!�!�!�!�!�������2�2�2�2�2�2�2�2���w����N�N�N�N�����������������������d4�d4�d4�d4�d4�d4�d4�d4�NM�M�M�M�M�M�M�M�b �Z���
�
��	�	�	�	�	�9�	�	�	��:��@�����s�A#�#A-�,A-

Zerion Mini Shell 1.0