# SPDX-License-Identifier: EPL-1.0
##############################################################################
-# Copyright (c) 2017 The Linux Foundation and others.
+# Copyright (c) 2017, 2023 The Linux Foundation and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
#
# Contributors:
# Thanh Ha - Initial implementation
+# Linux Foundation Release Engineering
##############################################################################
"""lftools package."""
+from __future__ import annotations
__author__ = "Thanh Ha"
__summary__ = "Linux Foundation Release Engineering Tools"
class LogFormatter(logging.Formatter):
"""Custom log formatter."""
- default_fmt = logging.Formatter("%(levelname)s: %(message)s")
- debug_fmt = logging.Formatter("%(levelname)s: %(name)s:%(lineno)d: %(message)s")
- info_fmt = logging.Formatter("%(message)s")
+ default_fmt: logging.Formatter = logging.Formatter("%(levelname)s: %(message)s")
+ debug_fmt: logging.Formatter = logging.Formatter("%(levelname)s: %(name)s:%(lineno)d: %(message)s")
+ info_fmt: logging.Formatter = logging.Formatter("%(message)s")
- def format(self, record):
+ def format(self, record: logging.LogRecord) -> str:
"""Format log messages depending on log level."""
if record.levelno == logging.INFO:
return self.info_fmt.format(record)
--- /dev/null
+[mypy]
+warn_return_any = True
+warn_unused_configs = True
+
+[mypy-defusedxml.minidom.*]
+ignore_missing_imports = True
+
+[mypy-docker.*]
+ignore_missing_imports = True
+
+[mypy-jenkins.*]
+ignore_missing_imports = True
+
+[mypy-ldap.*]
+ignore_missing_imports = True
+
+[mypy-oauth2client.*]
+ignore_missing_imports = True
+
+[mypy-pygerrit2.*]
+ignore_missing_imports = True
+
+[mypy-ruamel.*]
+ignore_missing_imports = True