From 90ba596239ec637c5da0713ca8eff27bf4c233d9 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Wed, 28 Jun 2023 08:19:04 +0200 Subject: [PATCH] fix linting --- ansibledoctor/config.py | 7 ++++--- ansibledoctor/file_registry.py | 4 ---- ansibledoctor/utils.py | 3 ++- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/ansibledoctor/config.py b/ansibledoctor/config.py index 0876219d..9b00c090 100644 --- a/ansibledoctor/config.py +++ b/ansibledoctor/config.py @@ -2,6 +2,7 @@ """Global settings definition.""" import os +from typing import ClassVar import anyconfig import environs @@ -18,7 +19,7 @@ default_envs_prefix = "ANSIBLE_DOCTOR_" -class Config(): +class Config: """ Create an object with all necessary settings. @@ -28,7 +29,7 @@ class Config(): - provides cli parameters """ - SETTINGS = { + SETTINGS: ClassVar[dict[dict]] = { "config_file": { "default": default_config_file, "env": "CONFIG_FILE", @@ -125,7 +126,7 @@ class Config(): }, } - ANNOTATIONS = { + ANNOTATIONS: ClassVar[dict[dict]] = { "meta": { "name": "meta", "automatic": True, diff --git a/ansibledoctor/file_registry.py b/ansibledoctor/file_registry.py index adbe4863..43d6e1fb 100644 --- a/ansibledoctor/file_registry.py +++ b/ansibledoctor/file_registry.py @@ -14,10 +14,6 @@ class Registry: """Register all yaml files.""" - _doc = {} - log = None - config = None - def __init__(self): self._doc = [] self.config = SingleConfig() diff --git a/ansibledoctor/utils.py b/ansibledoctor/utils.py index e8266e03..912c5b87 100644 --- a/ansibledoctor/utils.py +++ b/ansibledoctor/utils.py @@ -6,6 +6,7 @@ import sys from collections.abc import Iterable from distutils.util import strtobool +from typing import ClassVar import colorama from pythonjsonlogger import jsonlogger @@ -77,7 +78,7 @@ def _split_string(string, delimiter, escape, maxsplit=None): class Singleton(type): """Meta singleton class.""" - _instances = {} + _instances: ClassVar[dict] = {} def __call__(cls, *args, **kwargs): if cls not in cls._instances: