Fix: select_subclass now supports dotted class names (Fixes #56)#169
Fix: select_subclass now supports dotted class names (Fixes #56)#169RajT393 wants to merge 1 commit into
Conversation
|
Hi @RajT393! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
1 similar comment
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
📝 Summary
This pull request fixes Issue #56 by updating the
select_subclass()selector to correctly match class definitions that inherit from dotted base class names (e.g.,module.BaseClass), which were previously ignored.🐞 Problem
The
select_subclass()selector inbowler/query.pyonly supported simple base class names likeBaseClass.It failed to match subclasses that inherit from dotted names such as
module.BaseClass, because it didn’t traverseast.Attributenodes in the AST.✅ Fix
The function has been enhanced to:
NameandAttributenodes in the ASTmodule.BaseClass)🧪 Changes Made
select_subclass()to walk throughAttributenodestests/test_query.pyto verify subclass matching with dotted base classespytestran successfully)🔍 Example
Before:
After:
🔗 Related Issue
Fixes #56