File tree 2 files changed +8
-8
lines changed
2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -409,12 +409,10 @@ def sections_in_wrong_order(self):
409
409
410
410
def deprecation_in_wrong_order (self ):
411
411
"""
412
- This is what old method does .
412
+ This docstring has the deprecation warning in the wrong order .
413
413
414
- This is an extended summary with more details about
415
- what `some_old_method` does.
416
-
417
- The extended summary can contain multiple paragraphs.
414
+ This is the extended summary. The correct order should be
415
+ summary, deprecation warning, extended summary.
418
416
419
417
.. deprecated:: 1.0
420
418
This should generate an error as it needs to go before
Original file line number Diff line number Diff line change @@ -625,9 +625,11 @@ def get_validation_data(doc):
625
625
errs .append (error ('GL07' ,
626
626
correct_sections = ', ' .join (correct_order )))
627
627
628
- if (doc .deprecated and not doc .name .startswith ('pandas.Panel' )
629
- and not doc .extended_summary .startswith ('.. deprecated:: ' )):
630
- errs .append (error ('GL09' ))
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' ))
631
633
632
634
if not doc .summary :
633
635
errs .append (error ('SS01' ))
You can’t perform that action at this time.
0 commit comments