File tree 1 file changed +8
-8
lines changed
1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -492,12 +492,14 @@ def first_line_ends_in_dot(self):
492
492
if self .doc :
493
493
return self .doc .split ('\n ' )[0 ][- 1 ] == '.'
494
494
495
+ @property
496
+ def deprecated_with_directive (self ):
497
+ return ('.. deprecated:: ' in (self .summary + self .extended_summary ))
498
+
495
499
@property
496
500
def deprecated (self ):
497
- pattern = re .compile ('.. deprecated:: ' )
498
501
return (self .name .startswith ('pandas.Panel' )
499
- or bool (pattern .search (self .summary ))
500
- or bool (pattern .search (self .extended_summary )))
502
+ or self .deprecated_with_directive )
501
503
502
504
@property
503
505
def mentioned_private_classes (self ):
@@ -625,11 +627,9 @@ def get_validation_data(doc):
625
627
errs .append (error ('GL07' ,
626
628
correct_sections = ', ' .join (correct_order )))
627
629
628
- pattern = re .compile ('.. deprecated:: ' )
629
- if (bool (pattern .search (doc .summary ))
630
- or bool (pattern .search (doc .extended_summary ))):
631
- if not doc .extended_summary .startswith ('.. deprecated:: ' ):
632
- errs .append (error ('GL09' ))
630
+ if (doc .deprecated_with_directive
631
+ and not doc .extended_summary .startswith ('.. deprecated:: ' )):
632
+ errs .append (error ('GL09' ))
633
633
634
634
if not doc .summary :
635
635
errs .append (error ('SS01' ))
You can’t perform that action at this time.
0 commit comments