Skip to content

Commit b02cbe6

Browse files
committed
refactor: lint-hotkeys: Make the integer error flag boolean.
1 parent 4afff89 commit b02cbe6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tools/lint-hotkeys

+5-5
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def lint_hotkeys_file() -> None:
3939
existing OUTPUT_FILE
4040
"""
4141
hotkeys_file_string = get_hotkeys_file_string()
42-
error_flag = 0 if is_every_key_category_valid() else 1
42+
error_flag = not is_every_key_category_valid()
4343
# To lint keys description
4444
categories = read_help_categories()
4545
for action in HELP_CATEGORIES:
@@ -53,7 +53,7 @@ def lint_hotkeys_file() -> None:
5353
f"Description - ({help_text}) for key combination - [{various_key_combinations}]\n"
5454
"It should contain only alphabets, spaces and special characters except ."
5555
)
56-
error_flag = 1
56+
error_flag = True
5757
# Check key combination duplication
5858
check_duplicate_keys_list = [
5959
key for key in check_duplicate_keys_list if key not in KEYS_TO_EXCLUDE
@@ -67,16 +67,16 @@ def lint_hotkeys_file() -> None:
6767
print(
6868
f"Duplicate key combination for keys {duplicate_keys} for category ({HELP_CATEGORIES[action]}) detected"
6969
)
70-
error_flag = 1
71-
if error_flag == 1:
70+
error_flag = True
71+
if error_flag is True:
7272
print(f"Rerun this command after resolving errors in config/{KEYS_FILE_NAME}")
7373
else:
7474
print("No hotkeys linting errors")
7575
if not output_file_matches_string(hotkeys_file_string):
7676
print(
7777
f"Run './tools/{SCRIPT_NAME} --fix' to update {OUTPUT_FILE_NAME} file"
7878
)
79-
error_flag = 1
79+
error_flag = True
8080
sys.exit(error_flag)
8181

8282

0 commit comments

Comments
 (0)