Skip to content

Commit dae5a76

Browse files
committed
Removed hardcoded 'pandas.Panel' check, changed description in test file
1 parent 3950b3c commit dae5a76

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

scripts/tests/test_validate_docstrings.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -409,12 +409,10 @@ def sections_in_wrong_order(self):
409409

410410
def deprecation_in_wrong_order(self):
411411
"""
412-
This is what old method does.
412+
This docstring has the deprecation warning in the wrong order.
413413
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.
418416
419417
.. deprecated:: 1.0
420418
This should generate an error as it needs to go before

scripts/validate_docstrings.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -625,9 +625,11 @@ def get_validation_data(doc):
625625
errs.append(error('GL07',
626626
correct_sections=', '.join(correct_order)))
627627

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'))
631633

632634
if not doc.summary:
633635
errs.append(error('SS01'))

0 commit comments

Comments
 (0)