-
-
Notifications
You must be signed in to change notification settings - Fork 21
Fix all method and property aliases #283
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a metaclass-based system for validating method and property aliases in the libdebug library to ensure consistency between original methods/properties and their aliases.
- Adds a new metaclass
AliasedClassthat validates signature and docstring consistency between aliased methods and properties - Introduces decorators
@aliasand@aliased_propertyto mark methods and properties with their aliases - Updates existing alias methods and properties to use the new decorators and ensure proper docstring formatting
Reviewed Changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
test/scripts/alias_test.py |
Adds test cases to verify the metaclass validation works correctly |
libdebug/utils/oop/aliased_class.py |
Implements the metaclass that validates alias consistency during class creation |
libdebug/utils/oop/alias.py |
Provides decorators for marking methods and properties with aliases |
libdebug/state/thread_context.py |
Updates aliases to use new decorators and fixes docstrings |
libdebug/debugger/debugger.py |
Updates aliases to use new decorators and fixes docstrings and method signatures |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Makes absolutely no sense that this works locally but not in the CI
|
Do we really want decorators on each method and property just for test purposes? That's weird and confusing for those who read the code. I will not comment on the swe overcomplicated checks :) |
|
I will leave to @Frank01001 the burden of approving or rejecting this PR, as I believe that having aliases declared in the code is far better than only declaring them in the test suite. We could maybe rename |
|
|
I finally managed to introduce metaclasses in libdebug.