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
8 changes: 7 additions & 1 deletion tools/lint-hotkeys
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ def lint_hotkeys_file() -> None:
else:
print("No hotkeys linting errors")
if not output_file_matches_string(hotkeys_file_string):
print(f"Run './tools/{SCRIPT_NAME}' to update {OUTPUT_FILE_NAME} file")
print(
f"Run './tools/{SCRIPT_NAME} --fix' to update {OUTPUT_FILE_NAME} file"
)
error_flag = 1
sys.exit(error_flag)

Expand Down Expand Up @@ -118,6 +120,10 @@ def get_hotkeys_file_string() -> str:


def output_file_matches_string(hotkeys_file_string: str) -> bool:
"""
Read the content of the existing OUTPUT_FILE as a string
and check if it matches the newly generated hotkeys_file_string
"""
with open(OUTPUT_FILE) as output_file:
content_is_identical = hotkeys_file_string == output_file.read()
if content_is_identical:
Expand Down