diff --git a/healthcheck/healthcheck.py b/healthcheck/healthcheck.py index 6a71b13..3064651 100644 --- a/healthcheck/healthcheck.py +++ b/healthcheck/healthcheck.py @@ -79,11 +79,11 @@ class Healthcheck: def __init__( self, name: str, - components: List[HealthcheckComponentInterface] = [], + components: Optional[List[HealthcheckComponentInterface]] = None, warn_is_unhealthy: bool = False, ) -> None: self.name = name - self.components: List[HealthcheckComponentInterface] = components + self.components: List[HealthcheckComponentInterface] = components or [] self.warn_is_unhealthy = warn_is_unhealthy self.checks: Dict[str, List[HealthcheckComponentStatus]] = {} diff --git a/poetry.lock b/poetry.lock index e617dd7..27f005e 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,22 @@ -# This file is automatically @generated by Poetry 1.5.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand. + +[[package]] +name = "attrs" +version = "23.1.0" +description = "Classes Without Boilerplate" +optional = false +python-versions = ">=3.7" +files = [ + {file = "attrs-23.1.0-py3-none-any.whl", hash = "sha256:1f28b4522cdc2fb4256ac1a020c78acf9cba2c6b461ccd2c126f3aa8e8335d04"}, + {file = "attrs-23.1.0.tar.gz", hash = "sha256:6279836d581513a26f1bf235f9acd333bc9115683f14f7e8fae46c98fc50e015"}, +] + +[package.extras] +cov = ["attrs[tests]", "coverage[toml] (>=5.3)"] +dev = ["attrs[docs,tests]", "pre-commit"] +docs = ["furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib-towncrier", "towncrier", "zope-interface"] +tests = ["attrs[tests-no-zope]", "zope-interface"] +tests-no-zope = ["cloudpickle", "hypothesis", "mypy (>=1.1.1)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] [[package]] name = "black" @@ -164,6 +182,24 @@ mccabe = ">=0.7.0,<0.8.0" pycodestyle = ">=2.11.0,<2.12.0" pyflakes = ">=3.1.0,<3.2.0" +[[package]] +name = "flake8-bugbear" +version = "23.12.2" +description = "A plugin for flake8 finding likely bugs and design problems in your program. Contains warnings that don't belong in pyflakes and pycodestyle." +optional = false +python-versions = ">=3.8.1" +files = [ + {file = "flake8-bugbear-23.12.2.tar.gz", hash = "sha256:32b2903e22331ae04885dae25756a32a8c666c85142e933f43512a70f342052a"}, + {file = "flake8_bugbear-23.12.2-py3-none-any.whl", hash = "sha256:83324bad4d90fee4bf64dd69c61aff94debf8073fbd807c8b6a36eec7a2f0719"}, +] + +[package.dependencies] +attrs = ">=19.2.0" +flake8 = ">=6.0.0" + +[package.extras] +dev = ["coverage", "hypothesis", "hypothesmith (>=0.2)", "pre-commit", "pytest", "tox"] + [[package]] name = "iniconfig" version = "2.0.0" @@ -399,4 +435,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.8.1" -content-hash = "cfa3dd45bd1a170b5601e492f55f8d8145563bb3f443a510f20fbcc0607d782b" +content-hash = "99af2562fb506e695a0097d1afeeec051d497ea04ee44180607d626bb17214a9" diff --git a/pyproject.toml b/pyproject.toml index b2f5fd4..4a29e76 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,6 +17,7 @@ isort = "^5.12.0" flake8 = "^6.1.0" mypy = "^1.6.1" pytest-cov = "^4.1.0" +flake8-bugbear = "^23.12.2" [build-system] requires = ["poetry-core"]