This repository was archived by the owner on Nov 3, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change 1
- from pydocstyle .checker import check
1
+ from pydocstyle .checker import check , check_source
2
2
from pydocstyle .violations import Error , conventions
3
3
from pydocstyle .utils import __version__
4
4
Original file line number Diff line number Diff line change 1
1
"""Parsed source code checkers for docstring violations."""
2
2
3
3
import tokenize as tk
4
+ import warnings
4
5
5
6
from pydocstyle import violations
6
7
from pydocstyle .checkers import get_checkers
9
10
from pydocstyle .utils import log
10
11
11
12
12
- __all__ = ('check' , )
13
+ __all__ = ('check' , 'check_source' )
13
14
14
15
15
16
class ConventionChecker :
16
- """Checker for PEP 257 and numpy conventions.
17
+ """Deprecated: Checker for PEP 257 and numpy conventions.
18
+
19
+ Deprecated class. Use `pydocstyle.check_source` instead.
20
+ >>> from pydocstyle import check_source
21
+ >>> check_source(source, filename, ignore_decorators=None)
17
22
18
23
D10x: Missing docstrings
19
24
D20x: Whitespace issues
@@ -22,11 +27,18 @@ class ConventionChecker:
22
27
23
28
"""
24
29
30
+ def __init__ (self ):
31
+ warnings .warn ("`ConventionChecker` is deprecated. "
32
+ "Use the `pydocstyle.check_source` instead" , DeprecationWarning )
33
+
25
34
def check_source (self , source , filename , ignore_decorators = None ):
35
+ warnings .warn ("`ConventionChecker.check_source` is deprecated. "
36
+ "Use `pydocstyle.check_source` instead" , DeprecationWarning )
26
37
yield from check_source (source , filename , ignore_decorators = ignore_decorators )
27
38
28
39
@property
29
40
def checks (self ):
41
+ warnings .warn ("`ConventionChecker.checks` is deprecated." , DeprecationWarning )
30
42
return _get_checks ()
31
43
32
44
You can’t perform that action at this time.
0 commit comments