Skip to content

Commit 2929833

Browse files
committed
Use the argparse config handler in docstring_checker.py
1 parent b799ced commit 2929833

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

pylint/checkers/base/docstring_checker.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ class DocStringChecker(_BasicChecker):
101101
),
102102
)
103103

104+
def __init__(
105+
self, linter=None, *, future_option_parsing: Literal[None, True] = None
106+
):
107+
_BasicChecker.__init__(self, linter, future_option_parsing=True)
108+
104109
def open(self):
105110
self.linter.stats.reset_undocumented()
106111

pylint/config/argument.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@
88
"""
99

1010

11-
from typing import Callable, Dict, List, Optional, Union
11+
import re
12+
from typing import Callable, Dict, List, Optional, Pattern, Union
1213

1314
from pylint import utils as pylint_utils
1415

15-
_ArgumentTypes = Union[str, List[str]]
16+
_ArgumentTypes = Union[str, List[str], int, Pattern[str]]
1617
"""List of possible argument types."""
1718

1819

@@ -24,6 +25,8 @@ def _csv_transformer(value: str) -> List[str]:
2425
_TYPE_TRANSFORMERS: Dict[str, Callable[[str], _ArgumentTypes]] = {
2526
"choice": str,
2627
"csv": _csv_transformer,
28+
"int": int,
29+
"regexp": re.compile,
2730
}
2831
"""Type transformers for all argument types.
2932

0 commit comments

Comments
 (0)