From 5997401e9e9ab19e24ae6bba33ef6bd8670b4df0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Feb 2023 11:55:36 +1300 Subject: [PATCH] Bump pylint from 2.15.10 to 2.16.2 (#4426) * Bump pylint from 2.15.10 to 2.16.2 Bumps [pylint](https://github.com/PyCQA/pylint) from 2.15.10 to 2.16.2. - [Release notes](https://github.com/PyCQA/pylint/releases) - [Commits](https://github.com/PyCQA/pylint/compare/v2.15.10...v2.16.2) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Lint --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com> --- esphome/cpp_generator.py | 7 +++---- esphome/dashboard/dashboard.py | 2 +- esphome/loader.py | 8 ++++---- requirements_test.txt | 2 +- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/esphome/cpp_generator.py b/esphome/cpp_generator.py index a423554d10..789bd58e5c 100644 --- a/esphome/cpp_generator.py +++ b/esphome/cpp_generator.py @@ -174,10 +174,9 @@ class ArrayInitializer(Expression): if not self.args: return "{}" if self.multiline: - cpp = "{\n" - for arg in self.args: - cpp += f" {arg},\n" - cpp += "}" + cpp = "{\n " + cpp += ",\n ".join(str(arg) for arg in self.args) + cpp += ",\n}" else: cpp = f"{{{', '.join(str(arg) for arg in self.args)}}}" return cpp diff --git a/esphome/dashboard/dashboard.py b/esphome/dashboard/dashboard.py index 0bc1b0886a..1a50592a2d 100644 --- a/esphome/dashboard/dashboard.py +++ b/esphome/dashboard/dashboard.py @@ -753,7 +753,7 @@ class BoardsRequestHandler(BaseHandler): platform_boards = {key: val[const.KEY_NAME] for key, val in boards.items()} # sort by board title boards_items = sorted(platform_boards.items(), key=lambda item: item[1]) - output = [dict(items=dict(boards_items))] + output = [{"items": dict(boards_items)}] self.set_header("content-type", "application/json") self.write(json.dumps(output)) diff --git a/esphome/loader.py b/esphome/loader.py index a0676eb90e..b245fa1610 100644 --- a/esphome/loader.py +++ b/esphome/loader.py @@ -167,10 +167,10 @@ def _lookup_module(domain): except Exception: # pylint: disable=broad-except _LOGGER.error("Unable to load component %s:", domain, exc_info=True) return None - else: - manif = ComponentManifest(module) - _COMPONENT_CACHE[domain] = manif - return manif + + manif = ComponentManifest(module) + _COMPONENT_CACHE[domain] = manif + return manif def get_component(domain): diff --git a/requirements_test.txt b/requirements_test.txt index a1c0845089..1e63f79b5e 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -1,4 +1,4 @@ -pylint==2.15.10 +pylint==2.16.2 flake8==6.0.0 # also change in .pre-commit-config.yaml when updating black==23.1.0 # also change in .pre-commit-config.yaml when updating pyupgrade==3.3.1 # also change in .pre-commit-config.yaml when updating