Skip to content

Commit 6793fae

Browse files
lint : Fixes the linting issue
-changes made in lint-hotkeys.
1 parent f55cd24 commit 6793fae

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

tools/lint-hotkeys

+10-9
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ from pathlib import Path, PurePath
77
from typing import Dict, List, Tuple
88

99
from zulipterminal.config.keys import (
10-
HELP_CATEGORIES,
11-
KEY_BINDINGS,
12-
display_keys_for_command,
10+
# HELP_CATEGORIES,
11+
# KEY_BINDINGS,
12+
# display_keys_for_command,
13+
key_config,
1314
)
1415

1516

@@ -42,7 +43,7 @@ def lint_hotkeys_file() -> None:
4243
# To lint keys description
4344
error_flag = 0
4445
categories = read_help_categories()
45-
for action in HELP_CATEGORIES:
46+
for action in key_config.HELP_CATEGORIES:
4647
check_duplicate_keys_list: List[str] = []
4748
for help_text, key_combinations_list in categories[action]:
4849
check_duplicate_keys_list.extend(key_combinations_list)
@@ -65,7 +66,7 @@ def lint_hotkeys_file() -> None:
6566
]
6667
if len(duplicate_keys) != 0:
6768
print(
68-
f"Duplicate key combination for keys {duplicate_keys} for category ({HELP_CATEGORIES[action]}) detected"
69+
f"Duplicate key combination for keys {duplicate_keys} for category ({key_config.HELP_CATEGORIES[action]}) detected"
6970
)
7071
error_flag = 1
7172
if error_flag == 1:
@@ -101,9 +102,9 @@ def get_hotkeys_file_string() -> str:
101102
f"<!--- Generated automatically by tools/{SCRIPT_NAME} -->\n"
102103
"<!--- Do not modify -->\n\n# Hot Keys\n"
103104
)
104-
for action in HELP_CATEGORIES:
105+
for action in key_config.HELP_CATEGORIES:
105106
hotkeys_file_string += (
106-
f"## {HELP_CATEGORIES[action]}\n"
107+
f"## {key_config.HELP_CATEGORIES[action]}\n"
107108
"|Command|Key Combination|\n"
108109
"| :--- | :---: |\n"
109110
)
@@ -135,9 +136,9 @@ def read_help_categories() -> Dict[str, List[Tuple[str, List[str]]]]:
135136
Get all help categories from KEYS_FILE
136137
"""
137138
categories = defaultdict(list)
138-
for cmd, item in KEY_BINDINGS.items():
139+
for cmd, item in key_config.KEY_BINDINGS.items():
139140
categories[item["key_category"]].append(
140-
(item["help_text"], display_keys_for_command(cmd))
141+
(item["help_text"], key_config.display_keys_for_command(cmd))
141142
)
142143
return categories
143144

0 commit comments

Comments
 (0)