
    e                       d dl mZ d dlZd dlmZ d dlmZ d dlmZmZ  G d d      Z	 G d d	e	      Z
 G d
 de	      Z G d de	      Z G d de	      Z G d de	      Ze
eeeedZh dZddddddddddddZh eddZddZy)    )annotationsN)Pattern)	constants)
OptionDictOptionsc                      e Zd ZU dZ ej
                  d      Zded<   eZded<   eZ	ded<   eZ
ded<   eZded<   eZded	<   eZded
<   edd       Zy)NamingStylea  Class to register all accepted forms of a single naming style.

    It may seem counter-intuitive that single naming style has multiple "accepted"
    forms of regular expressions, but we need to special-case stuff like dunder
    names in method names.
    z.*Pattern[str]ANYCLASS_NAME_RGXMOD_NAME_RGXCONST_NAME_RGXCOMP_VAR_RGXDEFAULT_NAME_RGXCLASS_ATTRIBUTE_RGXc                    | j                   | j                  | j                  | j                  | j                  | j                  | j                  | j                  | j                  | j                  | j
                  d|   S )Nmoduleconstclassfunctionmethodattrargumentvariableclass_attributeclass_const	inlinevar)r   r   r   r   r   r   )cls	name_types     P/usr/lib/python3/dist-packages/pylint/checkers/base/name_checker/naming_style.py	get_regexzNamingStyle.get_regex   s{     &&'''',,**((,,,,"66--))
  	    N)r    strreturnr
   )__name__
__module____qualname____doc__recompiler   __annotations__r   r   r   r   r   r   classmethodr"    r#   r!   r	   r	      sn     #

4(C(#&NL&!$L,$#&NL&!$L,$%(l((++ r#   r	   c                      e Zd ZdZ ej
                  d      Z ej
                  d      Z ej
                  d      ZeZ	 ej
                  d      Z
 ej
                  d      Zy)SnakeCaseStylez(Regex rules for snake_case naming style.z[^\W\dA-Z][^\WA-Z]*$z([^\W\dA-Z][^\WA-Z]*|__.*__)$z:([^\W\dA-Z][^\WA-Z]*|_[^\WA-Z]*|__[^\WA-Z\d_][^\WA-Z]+__)$Nr&   r'   r(   r)   r*   r+   r   r   r   r   r   r   r.   r#   r!   r0   r0   /   se    2RZZ 78N2::56LRZZ @AN!L!rzzE %"**%EFr#   r0   c                      e Zd ZdZ ej
                  d      Z ej
                  d      Z ej
                  d      ZeZ	 ej
                  d      Z
 ej
                  d      Zy)CamelCaseStylez'Regex rules for camelCase naming style.z[^\W\dA-Z][^\W_]*$z([^\W\dA-Z][^\W_]*|__.*__)$z'([^\W\dA-Z][^\W_]*|__[^\W\dA-Z_]\w+__)$Nr1   r.   r#   r!   r3   r3   <   sa    1RZZ 56N2::34LRZZ >?NL!rzz"LM$"**%CDr#   r3   c                      e Zd ZdZ ej
                  d      ZeZ ej
                  d      ZeZ	 ej
                  d      Z
 ej
                  d      Zy)PascalCaseStylez(Regex rules for PascalCase naming style.z[^\W\da-z][^\W_]*$z([^\W\da-z][^\W_]*|__.*__)$z'([^\W\da-z][^\W_]*|__[^\W\dA-Z_]\w+__)$Nr1   r.   r#   r!   r5   r5   G   sU    2RZZ 56N!LRZZ >?N!L!rzz"LM$"**%:;r#   r5   c                      e Zd ZdZ ej
                  d      ZeZ ej
                  d      ZeZ	 ej
                  d      Z
 ej
                  d      Zy)UpperCaseStylez(Regex rules for UPPER_CASE naming style.z[^\W\da-z][^\Wa-z]*$z([^\W\da-z][^\Wa-z]*|__.*__)$z)([^\W\da-z][^\Wa-z]*|__[^\W\dA-Z_]\w+__)$Nr1   r.   r#   r!   r7   r7   R   sU    2RZZ 78N!LRZZ @AN!L!rzz"NO$"**%<=r#   r7   c                      e Zd Zy)AnyStyleN)r&   r'   r(   r.   r#   r!   r9   r9   ]   s    r#   r9   )
snake_case	camelCase
PascalCase
UPPER_CASEany>   r   r   r   r   r   r   r   r   r   r   r   r:   r=   r<   r>   r   typevar	typealiasc                    g } t        t              D ]  }t        j                  |   }|j	                  dd      }d| d}|t
        v r	|d| dz  }|d| dz  }|t
        v rDt        |   }| j                  | d	|d
t        t        j                               dd| ddf       | j                  | dd dd|df        t        |       S )N_-z$Regular expression matching correct z names. z
Overrides z-naming-style. zIf left empty, z1 names will be checked with the set naming style.z-naming-stylechoicez<style>zNaming style matching correct z names.)defaulttypechoicesmetavarhelpz-rgxregexpz<regexp>)rE   rF   rH   rI   )sortedKNOWN_NAME_TYPESr   HUMAN_READABLE_TYPESreplaceKNOWN_NAME_TYPES_WITH_STYLEDEFAULT_NAMING_STYLESappendlistNAMING_STYLESkeystuple)name_optionsr    human_readable_namename_type_hyphenedhelp_msgdefault_styles         r!   _create_naming_optionsr[      s+   13L,- &
	'<<YG&..sC89:M9NhW33*%7$8HHH12 3) )	
 331)<M)*-8#0 (#'(:(:(<#=#,"@AT@UU\ ]	 	%&d+#$)$	
	
9&
N r#   )r%   r   )
__future__r   r*   r   pylintr   pylint.typingr   r   r	   r0   r3   r5   r7   r9   rS   rO   rP   rL   r[   r.   r#   r!   <module>r_      s   
 # 	   - B
G[ 
GE[ E<k <>[ >	{ 	
 !!         )r#   