Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@MrIndeciso
Copy link
Member

I finally managed to introduce metaclasses in libdebug.

@MrIndeciso MrIndeciso requested review from Copilot and io-no September 28, 2025 19:13
Copy link

Copilot AI left a 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 AliasedClass that validates signature and docstring consistency between aliased methods and properties
  • Introduces decorators @alias and @aliased_property to 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.

@io-no
Copy link
Member

io-no commented Oct 12, 2025

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 :)

@MrIndeciso
Copy link
Member Author

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 alias to check_alias or similar.

@MrIndeciso MrIndeciso requested a review from Frank01001 October 20, 2025 14:56
@io-no
Copy link
Member

io-no commented Oct 20, 2025

check_alias is slightly better

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants