From cde67d3a710b20fbe25a1e22aeaa1a0ed552ae6f Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Thu, 29 Dec 2022 13:57:52 -0500 Subject: mypy: check sqldata.py --- coverage/types.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'coverage/types.py') diff --git a/coverage/types.py b/coverage/types.py index ee5ae010..015c3747 100644 --- a/coverage/types.py +++ b/coverage/types.py @@ -14,6 +14,8 @@ else: class Protocol: # pylint: disable=missing-class-docstring pass +## Configuration + # One value read from a config file. TConfigValue = Union[str, List[str]] # An entire config section, mapping option names to values. @@ -44,7 +46,26 @@ class TConfigurable(Protocol): """ +## Parsing + # Line numbers are pervasive enough that they deserve their own type. TLineNo = int TArc = Tuple[TLineNo, TLineNo] + +## Debugging + +class TWarnFn(Protocol): + """A callable warn() function.""" + def __call__(self, msg: str, slug: Optional[str]=None, once: bool=False,) -> None: + ... + + +class TDebugCtl(Protocol): + """A DebugControl object, or something like it.""" + + def should(self, option: str) -> bool: + """Decide whether to output debug information in category `option`.""" + + def write(self, msg: str) -> None: + """Write a line of debug output.""" -- cgit v1.2.1