From 4d8593402ef033108c04f69e02674608306fa3c6 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Tue, 17 May 2022 17:35:03 +0200 Subject: [PATCH] Fix no-implicit-reexport sorting issue (#72015) --- mypy.ini | 4 ++-- script/hassfest/mypy_config.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/mypy.ini b/mypy.ini index 0f698bda35d..8f0b1868bce 100644 --- a/mypy.ini +++ b/mypy.ini @@ -2518,10 +2518,10 @@ warn_unreachable = true [mypy-homeassistant.components.application_credentials.*] no_implicit_reexport = true -[mypy-homeassistant.components.spotify.*] +[mypy-homeassistant.components.diagnostics.*] no_implicit_reexport = true -[mypy-homeassistant.components.diagnostics.*] +[mypy-homeassistant.components.spotify.*] no_implicit_reexport = true [mypy-tests.*] diff --git a/script/hassfest/mypy_config.py b/script/hassfest/mypy_config.py index 3517307548b..0b705fab983 100644 --- a/script/hassfest/mypy_config.py +++ b/script/hassfest/mypy_config.py @@ -367,7 +367,9 @@ def generate_and_validate(config: Config) -> str: if strict_module in NO_IMPLICIT_REEXPORT_MODULES: mypy_config.set(strict_section, "no_implicit_reexport", "true") - for reexport_module in NO_IMPLICIT_REEXPORT_MODULES.difference(strict_modules): + for reexport_module in sorted( + NO_IMPLICIT_REEXPORT_MODULES.difference(strict_modules) + ): reexport_section = f"mypy-{reexport_module}" mypy_config.add_section(reexport_section) mypy_config.set(reexport_section, "no_implicit_reexport", "true")