:+in dZddlmZddlmZddlmZddlmZm Z m Z m Z m Z ddl mZddlmZd Zed gd ZGd d ZGddZeddZeddZeddZeddZeddZeddZeddZeddZed d!Zed"d#Z e d$d%d&Z!e d'd(d&Z"e d)d*d&Z#e d+d,d&Z$e d-d.d&Z%e d/d0d&Z&e d1d2Z'e d3d4Z(e d5d6Z)e d7d8Z*e d9d:Z+e d;dZ-e d?d@Z.e dAdBdCZ/e dDdEdFZ0edGdHZ1e1dIdJdKZ2e1dLdMZ3e1dNdOZ4edPdQZ5e5dRdSdTZ6e5dUdVdWZ7e5dUdXdYZ8e5dZd[Z9e5d\d]d^Z:e5d_d`Z;e5dadbd^Ze5dgdhdCZ?e5didjdkZ@e5dldmdCZAe5dndodCZBe5dpdqdCZCe5drdsdCZDe5dtdudCZEe5dvdwdTZFe5dxdyd^ZGe5dzd{d|ZHe5d}d~ZIe5ddZJGddeKZLeMeNZOeLeOhdz eOhdz eOhdz dZPdS)zDocstring violation definition.) namedtuple)partial) dropwhile)AnyCallableIterableListOptional) Definitionis_blank)Error ErrorRegistry conventions ErrorParams)code short_desccontextc eZdZdZdZdZdedededeeddf d Zd e d eddfd Z e d Z e dZ e defdZe defdZdefdZdefdZdddefdZdS)rzError in docstring style.Frrr parametersreturnNcZ||_||_||_||_d|_d|_dS)zYInitialize the object. `parameters` are specific to the created error. N)rrrr definition explanation)selfrrrrs /srv/buildsys-work-dir/castor/build_node/builder-2/WGSG1/unpkd_srcs/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/pydocstyle/violations.py__init__zError.__init__s5 $ $rrc"||_||_dS)z+Set the source code context for this error.N)rr)rrrs r set_contextzError.set_context+s$&rc$|jjjSN)rmodulenamers rzError.0sT_%;%@rc|jjSr#)r error_linenor&s rr'zError.1s !=rcp|jd|j}|j|jj|j}|d|dz }|S)z(Return the message to print to the user.z: Nz ())rrrformatr)rretspecific_error_msgs rmessagez Error.message3sS//do// < #!4!4do!F  -*--- -C rc |jdSd}|jjd}|jj}t t t t tt |}tt|t|z}d|d}t|D]5\}}|rd|z}|| ||z|z }|dkr|d z }n6|S) z,Return the source code lines for this error.NT)keependsz{:z}:{} z ... ) rsource splitlinesstartlistreversedrrlenstr enumerater,) rr5linesoffsetlines_stripped numbers_width line_formatnlines rr=z Error.lines<s ? "2&1141@@& T)Hhuoo>>?? @ @  C^)<)< <==>> 2M222  00  GAt "Tz k((VT:: :F1uu/) rc6jrz Error.__str__..TsA))x{{)))))))rz1{filename}:{line} {definition}: {message}z {explanation} {lines} z {lines} z {explanation} c2i|]}|t|S)getattr)rGr%rs r z!Error.__str__.._s5   gdD))   r)filenamerCrr/rr=rK)rjoinsplitr5explainr,)rtemplates` r__str__z Error.__str__Rs   #yy))+11$77)))  D H ; 04< 0 8 8HH [ 0 0  'HH \ 0$+ 0 / /Hx             rc t|Sr#)r;r&s r__repr__zError.__repr__ls4yyrotherc>|j|jf|j|jfkSr#)rNrC)rrVs r__lt__z Error.__lt__os ty)U^UZ,HHHr)__name__ __module__ __qualname____doc__rQr5r;rrr r!propertyrNrCr/r=rSrUboolrXrKrrrrsk##G F     c]       &'j's't'''' x@@AAH 8== > >D XsX*     4#IGIIIIIIIrrceZdZdZgZGddZedededefdZede efdZ edefd Z d S) rz1A registry of all error codes, divided to groups.c leZdZdZdededdfdZ d deded eedeeege ffd Z dS) ErrorRegistry.ErrorGroupz#A group of similarly themed errors.prefixr%rNc0||_||_g|_dS)zInitialize the object. `Prefix` should be the common prefix for errors in this group, e.g., "D1". `name` is the name of the group (its subject). N)rbr%errors)rrbr%s rrz!ErrorRegistry.ErrorGroup.__init__{s!DKDIDKKKr error_code error_desc error_contextct|||}ttg|R}|j||S)z9Create an error, register it to this group and return it.)rrrrdappend)rrerfrg error_paramsfactorys r create_errorz%ErrorRegistry.ErrorGroup.create_errorsE'z:}MMLe3l333G K  | , , ,Nrr#) rYrZr[r\r;rr rrrrlrKrr ErrorGroupraxs11 3 c d     ,0    $C=  x}ou, -      rrmrbr%rcf|||}|j||S)z'Create a new error group and return it.)rmgroupsri)clsrbr%groups r create_groupzErrorRegistry.create_groups2vt,, %    rc#DK|jD]}|jD] }|jV dS)zYield all registered codes.N)rordr)rprqerrors rget_error_codeszErrorRegistry.get_error_codessJZ ! !E ! !j     ! ! !rctd|jD}dd|dzzzdz}d|dzdzzd z}d }|jD]}||z }||z }|dd |jd |dzzd zz }||z }|jD]K}||z }|d|jd zd z|j|dzzd zz }L||z }|S)z;Output the registry as reStructuredText, for documentation.c3RK|]"}|jD]}t|jV#dSr#)rdr:r)rGrqrts rrIz'ErrorRegistry.to_rst..sZ      ! !       rz+------+-z+ | r3z| r1z**z| r )maxror%centerrdrrljust)rpmax_lensep_line blank_linetablerqrts rto_rstzErrorRegistry.to_rstsT        '! )<rrrrrrrrrrrrrrrrrr> rrrrrrrrr> rrrrrrrrrrrr)pep257numpygoogleN)Qr\ collectionsr functoolsr itertoolsrtypingrrrr r parserr utilsr__all__rrrrrD1xxrlrrrrrrrrD2xxrrrrrrrrrrrrrrrrD3xxrrrD4xxrrD401brrrrrrrrrrrrrrrrrrdictrsetru all_errorsrrKrrrs%%"""""":::::::::::::: 3j(I(I(IJJ _I_I_I_I_I_I_I_IDJJJJJJJJZ!!$(<==  (  '  (  *  )  '  .  # !!$(;<<  >   6   5   2   1   @   8  !     F  7  3   A  B      ( !!$88  $   0  1 !!$(BCC  )   -  =     :  A   6  1   ,   ,    K    ;7   &    '    E    +         %   *   4A   N   t S..00 1 1 h    *     E1133 r