Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions tools/lint-hotkeys
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def main(fix: bool) -> None:
if fix:
generate_hotkeys_file()
else:
lint_help_categories()
lint_hotkeys_file()


Expand Down Expand Up @@ -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
Expand Down
Loading