From c4cfba0b22067e397e7e22cdbf2b58c653b6e025 Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Mon, 31 Aug 2026 14:42:29 +0200 Subject: [PATCH] Add pylint checker to ensure flow menus have backing step handlers (#174796) --- pylint/plugins/README.md | 20 ++ .../checkers/config_flow/menu_options.py | 182 +++++++++++ tests/pylint/config_flow/test_menu_options.py | 297 ++++++++++++++++++ 3 files changed, 499 insertions(+) create mode 100644 pylint/plugins/pylint_home_assistant/checkers/config_flow/menu_options.py create mode 100644 tests/pylint/config_flow/test_menu_options.py diff --git a/pylint/plugins/README.md b/pylint/plugins/README.md index eae640b333b5..63ce62dd5f32 100644 --- a/pylint/plugins/README.md +++ b/pylint/plugins/README.md @@ -138,6 +138,7 @@ Every check has a code following the | `W7431` | [`home-assistant-options-flow-field-not-translated`](#w7431-home-assistant-options-flow-field-not-translated) | Options flow form field missing translation in `strings.json` | | `W7432` | [`home-assistant-subentry-flow-field-not-translated`](#w7432-home-assistant-subentry-flow-field-not-translated) | Subentry flow form field missing translation in `strings.json` | | `W7433` | [`home-assistant-missing-test-before-configure`](#w7433-home-assistant-missing-test-before-configure) | Config flow should test the connection before creating an entry | +| `W7434` | [`home-assistant-config-flow-menu-missing-step`](#w7434-home-assistant-config-flow-menu-missing-step) | `async_show_menu` option has no matching `async_step_*` method | | `W7435` | [`home-assistant-json-fixture`](#w7435-home-assistant-json-fixture) | Use a JSON fixture helper instead of parsing a loaded fixture | @@ -366,6 +367,25 @@ in config flows; they come automatically from the device or are set by the integration. +## `home_assistant_config_flow_menu_options` checker + +Validates that every option passed to +`self.async_show_menu(menu_options=...)` corresponds to an +`async_step_