diff --git a/tools/lint-hotkeys b/tools/lint-hotkeys index 83a7db068e..648b80b0c7 100755 --- a/tools/lint-hotkeys +++ b/tools/lint-hotkeys @@ -30,6 +30,7 @@ def main(fix: bool) -> None: if fix: generate_hotkeys_file() else: + lint_help_categories() lint_hotkeys_file() @@ -80,6 +81,22 @@ def lint_hotkeys_file() -> None: sys.exit(error_flag) +def lint_help_categories() -> None: + """ + Check if HELP_CATEGORIES contains all key categories + """ + missing_categories = [ + binding["key_category"] + for binding in KEY_BINDINGS.values() + if binding["key_category"] not in HELP_CATEGORIES + ] + if missing_categories: + print( + f"Missing categories in HELP_CATEGORIES (keys.py file): {missing_categories}" + ) + sys.exit(1) + + def generate_hotkeys_file() -> None: """ Generate OUTPUT_FILE based on help text description and