From 5bed7878834d37922966b11b4dd0e4eb2fe83b8f Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sun, 14 Nov 2021 08:30:10 -0800 Subject: [PATCH] add typing to src/flake8/__init__.py --- setup.cfg | 2 ++ src/flake8/__init__.py | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 763992b..fca70c6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -107,6 +107,8 @@ no_implicit_optional = true warn_unused_ignores = true # TODO: until we opt in all the modules +[mypy-flake8.__init__] +disallow_untyped_defs = true [mypy-flake8.defaults] disallow_untyped_defs = true [mypy-flake8.exceptions] diff --git a/src/flake8/__init__.py b/src/flake8/__init__.py index 6b40748..53bc407 100644 --- a/src/flake8/__init__.py +++ b/src/flake8/__init__.py @@ -11,6 +11,7 @@ This module """ import logging import sys +from typing import Optional from typing import Type LOG = logging.getLogger(__name__) @@ -40,7 +41,11 @@ LOG_FORMAT = ( ) -def configure_logging(verbosity, filename=None, logformat=LOG_FORMAT): +def configure_logging( + verbosity: int, + filename: Optional[str] = None, + logformat: str = LOG_FORMAT, +) -> None: """Configure logging for flake8. :param int verbosity: