From 718ec4102d56b5a76fff008468f8b1c3aec894fd Mon Sep 17 00:00:00 2001 From: Michael Maltsev <4129781+m417z@users.noreply.github.com> Date: Wed, 29 Jan 2025 23:25:32 +0200 Subject: [PATCH] Add hint for comments for modules that can't be represented by a variable name --- .github/pr_validation.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/pr_validation.py b/.github/pr_validation.py index eca37fa2e..9955068d0 100644 --- a/.github/pr_validation.py +++ b/.github/pr_validation.py @@ -299,7 +299,12 @@ def validate_symbol_hooks(path: Path): elif target_from_name or targets_from_comment: if target_from_name and not is_existing_windows_file_name(target_from_name): warning_msg = ( - f'"{target_from_name}" is not recognized as a Windows file name' + f'"{target_from_name}" is not recognized as a Windows file name.' + ' If the target module name can\'t be represented by a variable' + ' name, add the target module in a comment above the symbol hooks' + ' variable. Example:\n' + '// Taskbar.View.dll\n' + 'WindhawkUtils::SYMBOL_HOOK taskbarViewHooks[] = {...};' ) warnings += add_warning(path, line_num, warning_msg) @@ -312,15 +317,15 @@ def validate_symbol_hooks(path: Path): warning_msg = ( 'Please rename the symbol hooks variable to indicate the target module.' ' Examples (can end with "hook" or "hooks"):\n' - + '* user32DllHooks\n' - + '* user32dll_hooks\n' - + '* user32_dll_hooks\n' - + 'If the target module name can\'t be represented by a variable name, or' + '* user32DllHooks\n' + '* user32dll_hooks\n' + '* user32_dll_hooks\n' + 'If the target module name can\'t be represented by a variable name, or' ' if there is more than one target module, add all target modules in a' ' comment above the symbol hooks variable, separated with commas.' ' Example:\n' - + '// explorer.exe, taskbar.dll\n' - + 'WindhawkUtils::SYMBOL_HOOK hooks[] = {...};' + '// explorer.exe, taskbar.dll\n' + 'WindhawkUtils::SYMBOL_HOOK hooks[] = {...};' ) warnings += add_warning(path, line_num, warning_msg)