@@ -193,6 +193,27 @@ def contains(self, pat, case=True, na=np.nan):
193
193
"""
194
194
pass
195
195
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
+
196
217
197
218
class BadGenericDocStrings (object ):
198
219
"""Everything here has a bad docstring
@@ -374,6 +395,31 @@ def no_description_period(self, kind):
374
395
Doesn't end with a dot
375
396
"""
376
397
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
+
377
423
def parameter_capitalization (self , kind ):
378
424
"""
379
425
Forgets to capitalize the description.
@@ -513,7 +559,7 @@ def test_good_class(self):
513
559
514
560
@pytest .mark .parametrize ("func" , [
515
561
'plot' , 'sample' , 'random_letters' , 'sample_values' , 'head' , 'head1' ,
516
- 'contains' ])
562
+ 'contains' , 'mode' ])
517
563
def test_good_functions (self , func ):
518
564
assert validate_one (self ._import_path ( # noqa: F821
519
565
klass = 'GoodDocStrings' , func = func )) == 0
@@ -549,6 +595,8 @@ def test_bad_generic_functions(self, func):
549
595
'Parameter "kind: str" has no type' )),
550
596
('BadParameters' , 'no_description_period' ,
551
597
('Parameter "kind" description should finish with "."' ,)),
598
+ ('BadParameters' , 'no_description_period_with_directive' ,
599
+ ('Parameter "kind" description should finish with "."' ,)),
552
600
('BadParameters' , 'parameter_capitalization' ,
553
601
('Parameter "kind" description should start with a capital letter' ,)),
554
602
pytest .param ('BadParameters' , 'blank_lines' , ('No error yet?' ,),
0 commit comments