HBWU<BdZddlZddlZddlZddlmZddlmZm Z ddl m Z ddl m Z ddlmZdd lmZdd lmZmZmZmZmZmZmZmZmZmZmZmZdd lm Z m!Z!m"Z"m#Z#m$Z$dd l%m&Z&m'Z'm(Z(d Z)ddZ*GddZ+eZ, ddZ-dZ.dZ/dZ0dZ1dZ2dS)z5Parsed source code checkers for docstring violations.N) namedtuple)chain takewhile)compile)dedent) violations)IllegalConfiguration) AllErrorClass DefinitionFunctionMethodModule NestedClassNestedFunctionPackage ParseErrorParserStringIO)common_prefix_lengthis_blanklogpairwisestrip_non_alphanumeric)IMPERATIVE_BLACKLISTIMPERATIVE_VERBSstem)checkFcfd}|S)Nc$|_|_|SN) _check_for _terminal)fkindterminals /srv/buildsys-work-dir/castor/build_node/builder-2/WGSG1/unpkd_srcs/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/pydocstyle/checker.py decoratorzcheck_for..decorator(s  )r&r'r)s`` r( check_forr,'s* r*c|eZdZdZdZdZedZ d,dZe dZ e e d d Z e e d d Ze e d Ze edZe edZe e dZedZe e dZe e dZe e dZe e dZe e dZe e dZedZe e dZe e dZe edZ e edZ!e edZ"e edZ#e e dZ$ed Z%e&d!Z'e&d"Z(e&d#Z)ed$Z*ed%Z+ed&Z,e&d'Z-ed(Z.d)Z/d*Z0e e d+Z1dS)-ConventionCheckerzChecker for PEP 257, NumPy and Google conventions. D10x: Missing docstrings D20x: Whitespace issues D30x: Docstring formatting D40x: Docstring content issues ) z Short SummaryzExtended Summary ParametersReturnsYieldszOther ParametersRaisesSee AlsoNotes ReferencesExamples AttributesMethods)Args Arguments Attentionr7CautionDangerErrorExampler6Hint Importantz Keyword ArgszKeyword Argumentsr8Noter4Returnr0r2r5r3TipTodoWarningWarningsWarnsYieldr1z"^\s*(\w+)\s*(\(.*?\))?\s*:\n?\s*.+NFc#6K|in||_||_tt||}|D]}|jD]} d} t || jr|jdk} duotfd|j D} |s| s| s| |||j } nd} t| dr| n| g}|D]Z} | V|s| j |jvrF| j d}|\}}}| ||| V| jrd} n[| rnڌdS)NFallc3nK|]/}t|jdkV0dS)rN)lenfindallname).0decignore_decoratorss r( z1ConventionChecker.check_source..s]KK-55ch??@@1DKKKKKKr*__iter__z. ) explanation definitionT)property_decoratorsignore_self_only_initparserchecks isinstancer#skipped_error_codesany decorators docstringhasattrcode__doc__ partition set_contextr$)selfsourcefilenamerRrWignore_inline_noqarXmodulerV this_check terminate skipping_alldecorator_skiperrorerrorsrcmessage_rUs ` r( check_sourcezConventionChecker.check_sources&-BB3F  &;"x''22 ! ! J"k   ! j**?@@&#-#AU#JL%6d%B&sKKKK#-#8KKKHHN +%2>%,%!+  *j.B!!!%&-eZ&@&@MUUugF!' & & ,.-$z1OOO(2(:(D(DU(K(KI6?3GQ !--,7J.#(KKK)3&,0 %EA! ! r*cdtt|D}t|dS)Nc2g|]}t|d|S)r#)r`)rPrjs r( z,ConventionChecker.checks..s8   z<00    r*c|j Sr")r$)rjs r(z*ConventionChecker.checks..s j6J2Jr*key)varstypevaluessorted)rerKs r(rZzConventionChecker.checkssS  "4::..5577    cJJKKKKr*T)r'c6fd}|sjrttjttjt tjt|ttj tfdttj i}|tSdSdS)aD10{0,1,2,3}: Public definitions should have docstrings. All modules should normally have docstrings. [...] all functions and classes exported by a module should also have docstrings. Public methods (including the __init__ constructor) should also have docstrings. Note: Public (exported) definitions are either those with names listed in __all__ variable (if present), or those that do not start with a single underscore. cjrtjSjr4jrt jdkrdStjSjstj SdS)Nr) is_magicr D105is_initrXrM param_namesD107 is_overloadD102)rVresr(method_violationzCConventionChecker.check_docstring_missing..method_violationsy" )!(((! ). J233q884!((() )!(((4r*c<jstjndSr")rr D103)rVsr(rwz;ConventionChecker.check_docstring_missing..s#%1JO---r*N) is_publicrr D100r D101rD106rrrrrD104r{)rerVr_rcodess`` r(check_docstring_missingz)ConventionChecker.check_docstring_missings       -Z1 - zZ_(  E+5j))*,, , - - - -r*cv|r4ttj|rtjSdSdS)zD419: Docstring is empty. If the user provided a docstring but it was empty, it is like they never provided one. NOTE: This used to report as D10X errors. N)rast literal_evalr D419rerVr_s r(check_docstring_emptyz'ConventionChecker.check_docstring_emptysH  %#"29"="=>> %?$$ $ % % % %r*c|rztj|d}t|dkrBt d|D}|dkr%t jt|SdSdSdS)zD200: One-liner docstrings should fit on one line with quotes. The closing quotes are on the same line as the opening quotes. This looks better for one-liners.  rc38K|]}t|dVdS)rNrrPls r(rSz5ConventionChecker.check_one_liners..s-%J%JAhqkk%Ja%J%J%J%J%J%Jr*N)rrsplitrMsumr D200)rerVr_linesnon_empty_liness r(check_one_linersz"ConventionChecker.check_one_linerss  7$Y//55d;;E5zzA~~"%%J%J%J%J%J"J"J"a''%?3u::666  7 7~''r*c#K|rZ|j|\}}}ttt|ddd}ttt|ddd}t ttt|}t tt|} |dkrtj |Vt|sH| dkrD| dkr"td|stj| VdSdSdSdSdS)zD20{1,2}: No blank lines allowed around function/method docstring. There's no blank line either before or after the docstring unless directly followed by an inner function or class. rNrrz"\s+(?:(?:class|def|async def)\s|@))rfrclistmaprrrrboolreversedr D201rKrematchD202) refunctionr_beforerqafter blanks_before blanks_afterblanks_before_countblanks_after_counts r(check_no_blank_beforez'ConventionChecker.check_no_blank_beforesf  >'88CC FAu Xv||D/A/A#2#/F!G!GHHMHekk$.?.?.C D DEEL"%ih}6M6M&N&N"O"O !$Yt\%B%B!C!C "a'' o&9:::::|$$ >);q)@)@ '!++@AAGGNN,%/*<=======! > > > >)@)@ ,+r*c#K|rN|j|\}}}ttt|ddd}ttt|ddd}t ttt|}t tt|} |dkrtj |V|dkrtj |Vt|s | dkrtj| VdSdSdSdS)aD20{3,4}: Class docstring should have 1 blank line around them. Insert a blank line before and after all docstrings (one-line or multi-line) that document a class -- generally speaking, the class's methods are separated from each other by a single blank line, and the docstring needs to be offset from the first method by a blank line; for symmetry, put a blank line between the class header and the docstring. rNrrr)rfrcrrrrrrrrr D211D203rKD204) reclass_r_rrqrrrrrs r(check_blank_before_after_classz0ConventionChecker.check_blank_before_after_classsR(  :%}66yAA FAu Xv||D/A/A#2#/F!G!GHHMHekk$.?.?.C D DEEL"%ih}6M6M&N&N"O"O !$Yt\%B%B!C!C "a'' o&9:::::"a'' o&9:::::|$$ :);q)@)@ o&89999999 : : : :)@)@r*cv|rtj|d}t |dkrht t t|dd}ttt|}|dkrtj |SdSdSdS)aD205: Put one blank line between summary line and description. Multi-line docstrings consist of a summary line just like a one-line docstring, followed by a blank line, followed by a more elaborate description. The summary line may be used by automatic indexing tools; it is important that it fits on one line and is separated from the rest of the docstring by a blank line. rrN) rrstriprrMrrrrrrr D205)rerVr_rpost_summary_blanks blanks_counts r(check_blank_after_summaryz+ConventionChecker.check_blank_after_summary@s  9$Y//5577==dCCE5zzA~~&*3xqrr+C+C&D&D#"9T3F#G#GHH 1$$%?<888  9 9~%$r*ct|j|\}}}|d\}}}|S)z9Return the indentation of the docstring's opening quotes.r)rfrc rpartition)rVr_before_docstringrqindents r(_get_docstring_indentz'ConventionChecker._get_docstring_indentSs@",!2!.gsS4"'q1u!6!6t!.ls+NNN(1++N=++NNNr*z Nrr) rrrM enumeratesetjoinr D206minD208D207)rerVr_rindentsrs @r( check_indentzConventionChecker.check_indentZs  ,// IFFFOOD))E5zzA~~#,U#3#3 ONUNNNu::RWWW%5%5%>!?!???$/+++++LL1$$WSbS\):):V)C)CLL1$$v)=)=$/+++++w<.s4{{r*rrr)"""'''N)rrrrMrr D209rerVr_rs r("check_newline_after_last_paragraphz4ConventionChecker.check_newline_after_last_paragraphvs  -))44::4@@E 5zzA~~??4((,2244NJJ%?,,, - - ~JJr*c|rtj|d}|dds.t |dkr0|ddrt jSdSdSdS)z8D210: No whitespaces allowed surrounding docstring text.rr rN)rrr startswithrMrr D210rs r(check_surrounding_whitespacesz/ConventionChecker.check_surrounding_whitespacess  )$Y//55d;;Ea##C(( )u::??!H%%c**#"((( ) )#???r*c\|rgd}tj|d}t|dkrk|dd}||vrt jSt jSdSdS)zD21{2,3}: Multi-line docstring summary style check. A multi-line docstring summary should start either at the first, or separately at the second line of a docstring. )rrzu"""zu'''zr"""zr'''zur"""zur'''rrrN) rrrrMrlowerr D212D213)rerVr_ start_triplerfirsts r(check_multi_line_summary_startz0ConventionChecker.check_multi_line_summary_starts  -   L$Y//55d;;E5zzA~~!--a06688>>@@L((%?,,,%?,,,% - -~r*c8|rdtj|vrtd}ntd}||sMtd}||d}t j|SdSdS)aD300: Use """triple double quotes""". For consistency, always use """triple double quotes""" around docstrings. Use r"""raw triple double quotes""" if you use any backslashes in your docstrings. For Unicode docstrings, use u"""Unicode triple-quoted strings""". Note: Exception to this is made if the docstring contains """ quotes in its body. rz[uU]?[rR]?'''[^'].*z[uU]?[rR]?"""[^"].*z[uU]?[rR]?("+|'+).*rN)rrrrgroupr D300)rerVr_regexillegal_matcherillegal_quotess r(check_triple_double_quotesz,ConventionChecker.check_triple_double_quotess  7(3333122122;;y)) 7"$%?"@"@!0!6!6y!A!A!G!G!J!J!~666 7 7 7 7r*c|rJtd|r*|dstjSdSdSdS)aXD301: Use r""" if any backslashes in a docstring. Use r"""raw triple double quotes""" if you use any backslashes (\) in your docstrings. Exceptions are backslashes for line-continuation and unicode escape sequences \N... and \u... These are considered intended unescaped content in docstrings. z \\[^\nuN])rurN)rsearchrr D301rs r(check_backslashesz#ConventionChecker.check_backslashessp  %<  '' 22 %((55 % ?$$ $  % % % % % %r*c|retj|dd}||s||dSdSdS)aFirst line ends with one of `chars`. First line of the docstring should end with one of the characters in `chars`. `chars` supports either a `str` or an `Iterable[str]`. If the condition is evaluated to be false, it raises `violation`. rrrN)rrrrr)r_chars violation summary_lines r(_check_ends_withz"ConventionChecker._check_ends_withsz  3+I66<<>>DDTJJ1ML((// 3 yb!1222 3 3 3 3r*cD||dtjS)z}D400: First line should end with a period. The [first line of a] docstring is a phrase ending in a period. .)rr D400rs r(check_ends_with_periodz(ConventionChecker.check_ends_with_periods$$YZ_EEEr*cD||dtjS)zD415: should end with proper punctuation. The [first line of a] docstring is a phrase ending in a period, question mark, or exclamation point )r!?)rr D415rs r(check_ends_with_punctuationz-ConventionChecker.check_ends_with_punctuations%$$     r*c(|r|js||jstj|}|rt |d}|tvrtj |Stj t}|rG|vrEt|fd}tj||SdSdSdSdSdSdS)aD401: First line should be in imperative mood: 'Do', not 'Does'. [Docstring] prescribes the function or method's effect as a command: ("Do this", "Return that"), not as a description; e.g. don't write "Returns the pathname ...". rc$t|Sr")r)r% check_words r(rwz9ConventionChecker.check_imperative_mood..s&::q&I&Ir*rxN)is_test is_propertyrWrrrrrrrr D401brgetrmaxD401 capitalize)rerr_stripped first_word correct_formsbestrs @r(check_imperative_moodz'ConventionChecker.check_imperative_moodsU  J$ J(()ABB J ' 2288::H J3HNN4D4DQ4GHH '--// !555%+J777 0 4T*5E5E F F  JZ}%D%D%IIIID&?4??+<+'> KKK L L54r*cB|r|jrtjSdSdS)a"D418: Function decorated with @overload shouldn't contain a docstring. Functions that are decorated with @overload are definitions, and are for the benefit of the type checker only, since they will be overwritten by the non-@overload-decorated definition. N)rr D418)rerr_s r(check_if_neededz!ConventionChecker.check_if_needed@s8  %- %?$$ $ % % % %r*c|sdStj|}|sdSt|d}|dkrt jSdS)zD404: First word of the docstring should not be `This`. Docstrings should use short, simple language. They should not begin with "This class is [..]" or "This module contains [..]". Nrthis)rrrrrrr D404)rerr_rrs r(check_starts_with_thisz(ConventionChecker.check_starts_with_thisLs  F#I..4466  F+HNN,<,.sQ. . :;G ! ' ' ) ) 2 21 5 5. . . . . . r*)rrlstrip section_namer]rr4)r6section_name_suffixsection_suffix_is_only_colon punctuationprev_line_ends_with_punctuation#this_line_looks_like_a_section_name%prev_line_looks_like_end_of_paragraphs` r(_is_docstring_sectionz'ConventionChecker._is_docstring_section_sJ L   ' '(<(B(B(D(D E E K K M M (;c'A$DDD *-. . . . ?J. . . + + ' ( ) ) I-I , , Nx8M/N/N . 0 65 r*c#jKd}|jD]}t|sn4|dz }tj|Vtj|VdS|j|}dt |dk}|s6tj|V|dkrtj|VdSdS|dkrtj |V|dt|zkrDtj t||t|Vt||krtj |V|dz}|t|jkr|j|} t| ra|j|d} td| stj|VdStj|VdSdStj|VdS)a_D4{07,08,09,12,14}, D215: Section underline checks. Check for correct formatting for docstring sections. Checks that: * The line that follows the section name contains dashes (D40{7,8}). * The amount of dashes is equal to the length of the section name (D409). * The section's content does not begin in the line that follows the section header (D412). * The section has no content (D414). * The indentation of the dashed line is equal to the docstring's indentation (D215). rrNrr.)following_linesrr D407D414rrrD412D408rMD409rD215) clsr8r6 indentationblank_lines_after_headerrnon_empty_linedash_line_foundline_after_dashes_indexline_after_dashes rest_of_liness r(#_check_blanks_and_section_underlinez5ConventionChecker._check_blanks_and_section_underlines"$% +  DD>>  $ ) $ $/,// / / //,// / / / F 01IJ''#n&:&:&<&<"="=>>#E" 4/,// / / /'!++ ol3333333,+(!++ ol33333##%%s&B #'W-D)E)EEE$+$;+%!-..<$+$;/00%M$BGGM$:$:;;<(ol;;;;;;;(ol;;;;;;;<<!ol3333333r*c#NK|||}|j}|j|vr ||vrtj||jVt |j|krtj|V|jrt|jds4|j rtj |Vntj |Vt|j stj|V||||Ed{VdS)aD4{05,10,11,13}, D214: Section name checks. Check for valid section names. Checks that: * The section name is properly capitalized (D405). * The section is not over-indented (D214). * There's a blank line after the section (D410, D413). * There's a blank line before the section (D411). Also yields all the errors from `_check_blanks_and_section_underline`. rN)rr8titler D405rrD214rAris_last_sectionD413D410r4D411rP)rHr_rVr6valid_section_namesrIcapitalized_sections r(_check_common_sectionz'ConventionChecker._check_common_sectionsm// IFF %288::  (; ; ;#':::/"5w7KLL L L L  & & 4 4/"566 6 6 6& ;h  #B '/ /  ;& ; o&9:::::: o&9:::::-.. 7/"566 6 6 6:: +           r*c#K|||}|j}|||||jEd{V|j|j}|r.tj ||jV|dkr| |||Ed{VdSdS)a*D406: NumPy-style section name checks. Check for valid section names. Checks that: * The section name has no superfluous suffix to it (D406). Additionally, also yield all violations from `_check_common_section` which are style-agnostic section checks. Nr/) rr8rRr[NUMPY_SECTION_NAMESrrr7r D406_check_parameters_section)rHr_rVr6rIrZsuffixs r(_check_numpy_sectionz&ConventionChecker._check_numpy_sections$// IFF %288::,, z7C,C         ##%%,,W-ABB  M/"5w|7I7I7K7KLL L L L , . .44:w          / .r*c#Kt}t|j}d|jddd}t||ddD]\}}t||krtt|tt|kr| rsd|vr|dd\}} n| }|d} | D])} | | *t ||Ed{VdS)zD417: `Parameters` section check for numpy style. Check for a valid `Parameters` section. Checks that: * The section documents all function arguments (D417) except `self` or `cls` if it is a method. rz\ rrNr+r,) rrrrrArrziprMraddr._check_missing_args) r_rVr6docstring_argssection_level_indentcontent current_line next_line parametersparameter_typeparameter_list parameters r(r_z+ConventionChecker._check_parameters_section s,W\:: IIg- . . 6 6vr B B H H N N (+7GABBK'@'@ : : #L)|,,0DDD i0011- 556677OO%%7,&&1=1C1CC1K1K.J".!3!3!5!5J",!1!1#!6!6!/::I"&&y'8'89999$88 J           r*c# Kt}|jr7|jd}|dt|  t d fd|jD}g}|dD]D}|dds| |4|dxx|z cc<E|D]K}tj |} | r(| | dLt||Ed{VdS) aD417: `Args` section checks. Check for a valid `Args` or `Argument` section. Checks that: * The section documents all function arguments (D417) except `self` or `cls` if it is a method. Documentation for each arg should start at the same indentation level. For example, in this case x and y are distinguishable:: Args: x: Lorem ipsum dolor sit amet y: Ut enim ad minim veniam In the case below, we only recognize x as a documented parameter because the rest of the content is indented as if it belongs to the description for x:: Args: x: Lorem ipsum dolor sit amet y: Ut enim ad minim veniam rNrcJg|]}|s|dk| S)rr)rPrleading_whitespacess r(ruz9ConventionChecker._check_args_section..qsC':;;@Drzz?Izzr*T)keependsrr)rrArMr7rrr splitlinesisspaceappendr.GOOGLE_ARGS_REGEXrrdrre) r_rVr6rfr args_content args_sectionsrsectionrrrs @r(_check_args_sectionz%ConventionChecker._check_args_sectionPs.  " J 03J",-HJ4E4E4G4G0H0H/H-H"I  II ' 7     %''   ++T+:: * *D8##%% *$$T****b!!!T)!!!!$ 3 3G%7==gFFE 3""5;;q>>222$88 J           r*c#TKt|trt|j}|jdkr|js |dd}d|D}t ||z }|r@tjd t||j VdSdSdS)a3D417: Yield error for missing arguments in docstring. Given a list of arguments found in the docstring and the callable definition, it checks if all the arguments of the callable are present in the docstring, else it yields a D417 with a list of missing arguments. methodrNc0g|]}t||Sr+)is_def_arg_private)rParg_names r(ruz9ConventionChecker._check_missing_args..s6)(33r*z, ) r[rget_function_argsrfr& is_staticrr D417rr}rO)rfrV function_args missing_argss r(rez%ConventionChecker._check_missing_argss j( + + -j.?@@M(**:3G* -abb 1  -M }-->L  oIIf\2233Z_    r*c#K|j}|||||jEd{V|j|j}|dkr1tj|dz|jV|dvr| |||Ed{VdSdS)aD416: Google-style section name checks. Check for valid section names. Checks that: * The section does not contain any blank line between its name and content (D412). * The section is not empty (D414). * The section name has colon as a suffix (D416). Additionally, also yield all violations from `_check_common_section` which are style-agnostic section checks. Nr+)r9r:) r8rRr[GOOGLE_SECTION_NAMESrrr7r D416r{)rHr_rVr6rZr`s r(_check_google_sectionz'ConventionChecker._check_google_sections &288::,, z7C,D         ##%%,,W-ABB S==/#c)7<+=+=+?+?    "7 7 7..y*gNN N N N N N N N N N 8 7r*c #r Kd|D fdfdtD}tddfd|D}d|D}t|dD]H\}}|d n|j}|j|j|j|jd z||j|duVIdS) aGenerate `SectionContext` objects for valid sections. Given a list of `valid_section_names`, generate an `Iterable[SectionContext]` which provides: * Section Name * String value of the previous line * The section line * Following lines till the next section * Line index of the beginning of the section in the docstring * Boolean indicating whether the section is the last section. for each valid section. c6g|]}|Sr+)r)rPss r(ruz;ConventionChecker._get_section_contexts..s FFFQqwwyyFFFr*cNt|}|vSr")get_leading_wordsr)_lineresultlower_section_namess r(_suspected_as_sectionzFConventionChecker._get_section_contexts.._suspected_as_sections$&u{{}}55F00 0r*c0g|]\}}||Sr+r+)rPrrrs r(ruz;ConventionChecker._get_section_contexts..s>% % % !T1F1Ft1L1L% % % % r*SectionContext)r8r4rrAoriginal_indexrUc 3K|]S}t||dz ||dzd|dVTdS)rNF)rr)rPrrrs r(rSz:ConventionChecker._get_section_contexts..s    N!%(.."2"233a!e aa!egg          r*c3NK|] }t||V!dSr")r.r?)rPcs r(rSz:ConventionChecker._get_section_contexts..sJ  #4#J#J1#M#M       r*Nrr)rrrrr8r4r) rrYsuspected_section_indicescontextsabendrrrs ` @@@r(_get_section_contextsz'ConventionChecker._get_section_contextss_GF2EFFF 1 1 1 1 1 % % % % &u--% % % !$           /          Xt,,  DAq ""q'7C .a&*S01 T       r*c#Kd}|||jD]!}d}||||Ed{V"|S)aNumPy-style docstring sections checks. Check the general format of a sectioned docstring: '''This is my one-liner. Short Summary ------------- This is my summary. Returns ------- None. ''' Section names appear in `NUMPY_SECTION_NAMES`. Yields all violation from `_check_numpy_section` for each valid Numpy-style section. FTN)rr]ra)rerrVr_found_any_numpy_sectionctxs r(_check_numpy_sectionsz'ConventionChecker._check_numpy_sections sk(#(--eT5MNN M MC&* #00JLL L L L L L L L L&&r*c#K|||jD]}||||Ed{V dS)aGoogle-style docstring section checks. Check the general format of a sectioned docstring: '''This is my one-liner. Note: This is my summary. Returns: None. ''' Section names appear in `GOOGLE_SECTION_NAMES`. Yields all violation from `_check_google_section` for each valid Google-style section. N)rrr)rerrVr_rs r(_check_google_sectionsz(ConventionChecker._check_google_sections$sl$-- 4,   N NC11)ZMM M M M M M M M M N Nr*c#K|sdS|d}t|dkrdS||||Ed{V}|s||||Ed{VdSdS)zCheck for docstring sections.Nr)rrMrr)rerVr_r found_numpys r(check_docstring_sectionsz*ConventionChecker.check_docstring_sections;s  F%% u::>> F!%!;!; :y" "        22z9           r*)NNFF)2__name__ __module__ __qualname__rbr]rrrwrrpropertyrZr,r rrrrrr rr staticmethodrrrrrrrrrrrrr"r%r)r? classmethodrPr[rar_r{rerrrrrr+r*r(r.r.0s H 4  #////bLLXLYzD)))*-*-*)*-XYzD))) % %*) %Yz 7 7 7Yx>>>0Yu:::@Yz999$\ Yz,,,6Yz---"Yz ) ) )Yz---6Yz7774Yz%%%( 3 3\ 3YzFFFYz     YxJJJ<Yx ) ) )YxLLL Yx % % %Yz%%%$9 9 \9 vA4A4[A4F& & [& P[.- - \- ^9 9 \9 v\8OO[O2CC\CJ'''6NNN.Yzr*r.c #K||td||}n\|Itttjt|z }ntjj}|D]}tj d| tj |5} | } dddn #1swxYwYt| |||||D]} t| dd} | |vr| V#t t"t$f$r$} tjd|| | VYd} ~ d} ~ wtj$rt+d|zVYwxYwdS)aGenerate docstring errors that exist in `filenames` iterable. By default, the PEP-257 convention is checked. To specifically define the set of error codes to check for, supply either `select` or `ignore` (but not both). In either case, the parameter should be a collection of error code strings, e.g., {'D100', 'D404'}. When supplying `select`, only specified error codes will be reported. When supplying `ignore`, all error codes which were not specified will be reported. Note that ignored error code refer to the entire set of possible error codes, which is larger than just the PEP-257 convention. To your convenience, you may use `pydocstyle.violations.conventions.pep257` as a base set to add or remove errors from. `ignore_inline_noqa` controls if `# noqa` comments are respected or not. `ignore_self_only_init` controls if D107 is reported on __init__ only containing `self`. Examples --------- >>> check(['pydocstyle.py']) >>> check(['pydocstyle.py'], select=['D100']) >>> check(['pydocstyle.py'], ignore=conventions.pep257 - {'D100'}) Nz@Cannot pass both select and ignore. They are mutually exclusive.zChecking file %s.razError in file %s: %szinvalid syntax in file %s)r rrr ErrorRegistryget_error_codes conventionspep257rinfotkopenreadr.rrgetattrOSErrorr rwarning TokenError SyntaxError) filenamesselectignorerRrWrhrX checked_codesrgfilerfrnras r(rrQsRf0" +         (88:: ; ;c&kk I  #.5 FF $h/// F"" %d % % % % % % % % % % % % % % %*,,99!#"%  ufd33=((KKK :.    K.% @ @ @KKKKKKKK} F F F9HDEE E E E E E F'FFsCD%C: DC D C ADE3+E  &E32E3c4td|DS)zBReturn a boolean indicating if `string` only has ascii characters.c3<K|]}t|dkVdS)N)ord)rPr!s r(rSzis_ascii..s,224s4yy3222222r*)rKrs r(is_asciirs 226222 2 22r*cjtd|S)z'Return any leading space from `string`.z\s*)rrrrs r(rrs( f::  F # # ) ) + ++r*ctd|}||SdS)z{Return any leading set of words from `line`. For example, if `line` is " Hello world!!!", returns "Hello world". z[\w ]+N)rrrr)rrs r(rrsA  ]]  . .F ||~~r*c,|dS)z.s L L LXHL L L Lr*)rrYr7bodyargsr kwonlyargsr)function_sourcefunction_arg_node arg_nodeskwonly_arg_nodess r(rrsIo&<&<&>&>??DQGL  "&I(3 L Ly:J)K)K L L LLs69 AA)F)NNNNFF)3rbrrtokenizer collectionsr itertoolsrrrrtextwraprrr configr parserr r r rrrrrrrrrutilsrrrrr wordlistsrrr__all__r,r.rYrrrrrrr+r*r(rsp;; """"""&&&&&&&&((((((                            DCCCCCCCCC [[[[[[[[|   KFKFKFKF\333 ,,, $$$ MMMMMr*