@@ -193,6 +193,27 @@ def contains(self, pat, case=True, na=np.nan):
193193 """
194194 pass
195195
196+ def mode (self , axis , numeric_only ):
197+ """
198+ Ensure sphinx directives don't affect checks for trailing periods.
199+
200+ Parameters
201+ ----------
202+ axis : str
203+ Sentence ending in period, followed by single directive.
204+
205+ .. versionchanged:: 0.1.2
206+
207+ numeric_only : boolean
208+ Sentence ending in period, followed by multiple directives.
209+
210+ .. versionadded:: 0.1.2
211+ .. deprecated:: 0.00.0
212+ A multiline description,
213+ which spans another line.
214+ """
215+ pass
216+
196217
197218class BadGenericDocStrings (object ):
198219 """Everything here has a bad docstring
@@ -374,6 +395,31 @@ def no_description_period(self, kind):
374395 Doesn't end with a dot
375396 """
376397
398+ def no_description_period_with_directive (self , kind ):
399+ """
400+ Forgets to add a period, and also includes a directive.
401+
402+ Parameters
403+ ----------
404+ kind : str
405+ Doesn't end with a dot
406+
407+ .. versionadded:: 0.00.0
408+ """
409+
410+ def no_description_period_with_directives (self , kind ):
411+ """
412+ Forgets to add a period, and also includes multiple directives.
413+
414+ Parameters
415+ ----------
416+ kind : str
417+ Doesn't end with a dot
418+
419+ .. versionchanged:: 0.00.0
420+ .. deprecated:: 0.00.0
421+ """
422+
377423 def parameter_capitalization (self , kind ):
378424 """
379425 Forgets to capitalize the description.
@@ -513,7 +559,7 @@ def test_good_class(self):
513559
514560 @pytest .mark .parametrize ("func" , [
515561 'plot' , 'sample' , 'random_letters' , 'sample_values' , 'head' , 'head1' ,
516- 'contains' ])
562+ 'contains' , 'mode' ])
517563 def test_good_functions (self , func ):
518564 assert validate_one (self ._import_path ( # noqa: F821
519565 klass = 'GoodDocStrings' , func = func )) == 0
@@ -549,6 +595,8 @@ def test_bad_generic_functions(self, func):
549595 'Parameter "kind: str" has no type' )),
550596 ('BadParameters' , 'no_description_period' ,
551597 ('Parameter "kind" description should finish with "."' ,)),
598+ ('BadParameters' , 'no_description_period_with_directive' ,
599+ ('Parameter "kind" description should finish with "."' ,)),
552600 ('BadParameters' , 'parameter_capitalization' ,
553601 ('Parameter "kind" description should start with a capital letter' ,)),
554602 pytest .param ('BadParameters' , 'blank_lines' , ('No error yet?' ,),
0 commit comments