Skip to content

Commit

Permalink
Add hint for comments for modules that can't be represented by a vari…
Browse files Browse the repository at this point in the history
…able name
  • Loading branch information
m417z committed Jan 29, 2025
1 parent 2d855bf commit 718ec41
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions .github/pr_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)

Expand Down

0 comments on commit 718ec41

Please sign in to comment.