Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor improvements in lint hotkeys #1482

Closed
wants to merge 2 commits into from
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
Loading