mypy: set no_implicit_optional

The current version of PEP-484 indicates that
type checkers should not allow implicit optional
parameters.

- https://www.python.org/dev/peps/pep-0484/#union-types
- https://github.com/python/mypy/issues/9091

Change-Id: Ie3301798462a89af9fc0053070055a77a2437415
This commit is contained in:
Eric Harney 2022-08-11 13:16:57 -04:00
parent 25756c1279
commit aa97f4455c
2 changed files with 3 additions and 2 deletions

View File

@ -15,7 +15,7 @@
from __future__ import annotations
from typing import Any
from typing import Any, Optional # noqa: H301
from oslo_log import log as logging
from oslo_utils import netutils
@ -37,7 +37,7 @@ class RBDConnectorMixin(object):
@classmethod
def _get_rbd_args(cls,
connection_properties: dict[str, Any],
conf: str = None) -> list[str]:
conf: Optional[str] = None) -> list[str]:
user = connection_properties.get('auth_username')
monitor_ips = connection_properties.get('hosts')
monitor_ports = connection_properties.get('ports')

View File

@ -48,3 +48,4 @@ warn_unused_ignores = true
show_error_codes = true
pretty = true
html_report = mypy-report
no_implicit_optional = true